-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
[core] Optimize Theme Mode Selector in Header #4151
Comments
Assuming there are going to be many different ways of how users would want this to be executed (*), perhaps step 1 should be to create the minimum API necessary to customize this in user land. cc @apedroferreira Perhaps a quick win here could be to add a slot for the theme toggle? (*) I'm imagining
|
Sounds good, we have 2 slots in the header right now (account + additional actions), but the theme is outside of them. |
Hi, I would like to restore the user theme's choice when user logins back. Is it possible to provide a Slotprops for Theme's user action? |
@ebengtso Can you elaborate a bit more on what you're trying to do? Are you storing the dark/light mode choice in the user record on the backend? You should be able to already achieve that functionality with |
Thanks. Two distinct issues:
const {mode, setMode} = useColorScheme(); useEffect(() => { |
@ebengtso Here's a stackblitz that demonstrates |
In this case, where the hook is exported, the dashboard could have the option of a slot for the theme. This way, we could set it to null and customize it through the action or account slot. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @douglaszaltron How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Summary
When we have the ability in the theme to select mode (system, dark, and light), a toggle button is created in the header. However, this element occupies precious space in the header that could be used for other types of configurations. The proposal is to follow the MUI documentation style, where there is a gear button that contains configuration options, including the mode selector, along with other settings.
For example: language preferences, display preferences, among others.
Examples
Motivation
No response
Search keywords: theme
The text was updated successfully, but these errors were encountered: