-
-
Notifications
You must be signed in to change notification settings - Fork 295
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] Add toolbarActions and toolbarAccount slots to DashboardLayout #3984
[core] Add toolbarActions and toolbarAccount slots to DashboardLayout #3984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I thought it would improve the feature if we added a section in the DashboardLayout
docs page with an example on how to use this prop with a custom component - what do you think?
Not a blocker and can be done in a follow up
I took a look at the MUI X docs and I think they usually cover this kind of things just with the API reference pages. |
I believe the components pages are also about guiding people towards the right solution for their problem, rather than only demoing our features. If there's a specific use-case that is well solved by this slot then it would make sense to show that as a demo. |
This comment was marked as resolved.
This comment was marked as resolved.
Ended up adding 2 new separate slots actually: |
/** | ||
* @ignore - internal component. | ||
*/ | ||
function ToolbarActions() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placeholder component for later, but could just be null directly too.
Gonna merge this one, lmk if you have any further feedback! |
Closes #3983
Adds 2 new slots to the
DashboardLayout
component:toolbarActions
: for customizing toolbar actions to the left of the theme switcher;toolbarAccount
: to be able to replace/customize theAccount
component to the right of the theme switcher.Tried to follow how some other MUI libraries do things and the slots we already have in the
SignInPage
component.Also adds a "Slots" section in the API docs pages for
DashboardLayout
andSignInPage
by exporting Slots type interfaces in the respective components (they just needed to be namedDashboardLayoutSlots
, for example, to work automatically).The docs for DashboardLayout now include a simple example of how to add a search bar to the toolbar actions.
https://deploy-preview-3984--mui-toolpad-docs.netlify.app/toolpad/core/react-dashboard-layout/
https://deploy-preview-3984--mui-toolpad-docs.netlify.app/toolpad/core/api/dashboard-layout/
https://deploy-preview-3984--mui-toolpad-docs.netlify.app/toolpad/core/api/sign-in-page/