Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme Switcher on SignIn Page #4328

Open
aress31 opened this issue Oct 29, 2024 · 6 comments
Open

Theme Switcher on SignIn Page #4328

aress31 opened this issue Oct 29, 2024 · 6 comments
Assignees
Labels
component: sign-in enhancement This is not a bug, nor a new feature priority: low To delay as much as possible scope: toolpad-core Abbreviated to "core" waiting for 👍 Waiting for upvotes

Comments

@aress31
Copy link

aress31 commented Oct 29, 2024

Summary

Incorporating a theme switcher to toggle between dark and light modes on the SignIn/SignUp pages might be beneficial.

Examples

No response

Motivation

Enhancing UI/UX by providing users with the option to select their preferred mode from these pages.

Search keywords: signinpage

@aress31 aress31 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 29, 2024
@Janpot Janpot added waiting for 👍 Waiting for upvotes priority: low To delay as much as possible enhancement This is not a bug, nor a new feature labels Oct 29, 2024
@bharatkashyap bharatkashyap removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 29, 2024
@prakhargupta1 prakhargupta1 added the scope: toolpad-core Abbreviated to "core" label Oct 30, 2024
@apedroferreira
Copy link
Member

I have separated the ThemeSwitcher to its own separate component in #4340, but it's still under @toolpad/core/DashboardLayout.
If it makes sense to for this PR, we can make it its own separate component in @toolpad/core/ThemeSwitcher as part of it.

@Janpot
Copy link
Member

Janpot commented Nov 7, 2024

I feel like I've never seen this in a sign in page. perhaps we should benchmark existing solutions?

@prakhargupta1
Copy link
Member

prakhargupta1 commented Nov 12, 2024

I checked the UX of the following three websites and none of them have theme switcher on the sign-in page. It's part of the user's settings.

Notion sign-in page: Always shows light theme (even when my browser and Notion has the Dark theme enabled)
Slack: Same as above
Github sign-in page: Irrespective of my GitHub theme, it shows light/dark sign in page, based on my browser theme.

@SamuelLeapifai
Copy link

I'm also interested in this use case. If you won't implement it, can you at least advise what would be the recommended approach? ThemeSwitcher currently stores theme settings in context, so it needs AppProvider as a parent, right? Can I skip dashboard layout? I had som trouble getting this to work. My routes are configured that the AppProvider only renders for authenticated content. Public content (like login page) do not render it. If I add AppProvider on login page and the authenticated content shows a different instance of AppProvider, will this work? Will it use the same storage for theme?

@bharatkashyap
Copy link
Member

bharatkashyap commented Nov 15, 2024

I'm also interested in this use case. If you won't implement it, can you at least advise what would be the recommended approach? ThemeSwitcher currently stores theme settings in context, so it needs AppProvider as a parent, right? Can I skip dashboard layout? I had som trouble getting this to work. My routes are configured that the AppProvider only renders for authenticated content. Public content (like login page) do not render it. If I add AppProvider on login page and the authenticated content shows a different instance of AppProvider, will this work? Will it use the same storage for theme?

Pedro is best placed to answer this but he's out this week, I'll tag him here @apedroferreira so he can look at this next week and come back with a reply on what the most recommended way to do this could be

@apedroferreira
Copy link
Member

I'm also interested in this use case. If you won't implement it, can you at least advise what would be the recommended approach? ThemeSwitcher currently stores theme settings in context, so it needs AppProvider as a parent, right? Can I skip dashboard layout? I had som trouble getting this to work. My routes are configured that the AppProvider only renders for authenticated content. Public content (like login page) do not render it. If I add AppProvider on login page and the authenticated content shows a different instance of AppProvider, will this work? Will it use the same storage for theme?

Hi, yes the new ThemeSwitcher component that you can import from @toolpad/core/DashboardLayout needs to be wrapped by an AppProvider. The dashboard layout isn't needed to wrap it.

Our recommended approach is that a single instance of AppProvider wraps the whole application, but I think that a separate AppProvider should probably work in this case, as it would be using the same storage.

You can also take a look at the custom theme switcher example here (https://mui.com/toolpad/core/react-dashboard-layout/#examples) if you want another alternative and your theme uses CSS variables like the default theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: sign-in enhancement This is not a bug, nor a new feature priority: low To delay as much as possible scope: toolpad-core Abbreviated to "core" waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests

6 participants