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

Allow theme switcher override with slots #4340

Merged
merged 7 commits into from
Nov 7, 2024

Conversation

apedroferreira
Copy link
Member

@apedroferreira apedroferreira commented Oct 30, 2024

Closes #4151 and #4291

  • Include ThemeSwitcher component in toolbarActions slot so it can be hidden
  • Export existing ThemeSwitcher and ToolbarActions (default slot) components
  • Add example of popover menu & custom theme switcher in DashboardLayout demo page in docs

https://deploy-preview-4340--mui-toolpad-docs.netlify.app/toolpad/core/react-dashboard-layout/#customization

… components & add custom theme switcher example
@oliviertassinari oliviertassinari added component: layout This is the name of the generic UI component, not the React module! and removed component: DashboardLayout labels Nov 4, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 5, 2024
Copy link
Member

@bharatkashyap bharatkashyap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The demo and explanation of the slots seems clear to me. Perhaps we can have a diagram eventually when we have more slots

@apedroferreira
Copy link
Member Author

Looks good! The demo and explanation of the slots seems clear to me. Perhaps we can have a diagram eventually when we have more slots

Yeah, will kind of see how it evolves as we go, the new "Examples" section should help show some particular scenarios that might be useful.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 7, 2024
@apedroferreira
Copy link
Member Author

@bharatkashyap I just noticed this if you sign out in the "Account in sidebar" example:

Screenshot 2024-11-07 at 17 37 37

Probably no need to fix it in this release, just ran into it! Also not sure how to best handle it in the mini variant of the sidebar...

@apedroferreira apedroferreira merged commit caf962e into mui:master Nov 7, 2024
14 checks passed
@apedroferreira apedroferreira deleted the theme-switcher-slots branch November 7, 2024 17:41
@bharatkashyap
Copy link
Member

Probably no need to fix it in this release, just ran into it! Also not sure how to best handle it in the mini variant of the sidebar...

Thanks for that catch! I'll open an issue to track this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: layout This is the name of the generic UI component, not the React module! scope: toolpad-core Abbreviated to "core"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] Optimize Theme Mode Selector in Header
3 participants