Skip to content

Allow theme switcher override with slots#4340

Merged
apedroferreira merged 7 commits intomui:masterfrom
apedroferreira:theme-switcher-slots
Nov 7, 2024
Merged

Allow theme switcher override with slots#4340
apedroferreira merged 7 commits intomui:masterfrom
apedroferreira:theme-switcher-slots

Conversation

@apedroferreira
Copy link
Collaborator

@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
Copy link
Collaborator

@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
Collaborator 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
Collaborator 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
@apedroferreira apedroferreira deleted the theme-switcher-slots branch November 7, 2024 17:41
@bharatkashyap
Copy link
Collaborator

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

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