-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs] Improve Toolpad Core docs #43796
[docs] Improve Toolpad Core docs #43796
Conversation
Netlify deploy preview
@material-ui/core: parsed: +Infinity% , gzip: +Infinity% Bundle size reportDetails of bundle changes (Toolpad) |
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. We can add a notifications demo in a separate PR. I propose we just copy https://mui.com/toolpad/core/react-use-notifications/#close-notifications
I can update the current notifications demo in this PR itself, should be a small change |
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.
We are getting there 👍
|
||
### Page Container | ||
|
||
The [PageContainer](https://mui.com/toolpad/core/react-page-container/) component in `@toolpad/core` is the ideal wrapper for the content of your dashboard. It makes the Material UI Container navigation aware and extends it with page title, breadcrumbs, actions, and more. | ||
The [PageContainer](https://mui.com/toolpad/core/react-page-container/) component in `@toolpad/core` is the ideal wrapper for the content of your dashboard. It makes the Material UI Container navigation-aware and extends it with page title, breadcrumbs, actions, and more. | ||
|
||
{{"demo": "../breadcrumbs/PageContainerBasic.js", "height": 400, "hideToolbar": true}} |
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.
The dark/light mode is broken on all those demos.
As far as I understand things, theme={demoTheme}
shouldn't be provided, not be the AppProvider
responsibility to have this. Imagine I already have an application configured with a theme, I want some of my pages to have a Toolpad container, this shouldn't break. I mean, https://marmelab.com/react-admin/Theming.html feels wrong, no?
At minimum, MUI System should support theme nesting where you can inherit the light/dark mode and use different values for the other values.
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.
const demoWindow = window !== undefined ? window() : undefined;
feels confusing, I think it should copy
* Injected by the documentation to work in an iframe. |
to be clear.
docs/data/material/components/snackbars/ToolpadNotifications.tsx
Outdated
Show resolved
Hide resolved
docs/data/material/components/snackbars/ToolpadNotifications.tsx
Outdated
Show resolved
Hide resolved
|
||
// preview-start | ||
const key = online | ||
? notifications.show('You are now online', { |
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.
Can we change the position of the notification? It feels hard to see.
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.
The only way I can see how is to do this sort of a scoped notification: https://mui.com/toolpad/core/react-use-notifications/#scoped-notifications
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.
Then it sounds like a missing API. Creating an issue for Toolapd could be enough.
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.
But the position is the same as the other demos. Isn't this just hard to see because of the color? Maybe it's a matter of matching the look to the other demos?
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.
But the position is the same as the other demos. Isn't this just hard to see because of the color? Maybe it's a matter of matching the look to the other demos?
Yes, to match the look we need to add an alert
key to the slotProps
for NotificationsProvider
so that we can pass in variant: "filled"
to the Alert
being used in case a severity
prop is passed (which is the case in this demo). I can make an issue on Toolpad for this, let me know what you think
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.
the position is the same as the other demos. Isn't this just hard to see because of the color
Right fair, the position is correct, it's the visual design that is broken. https://notistack.com/features/basic for error looks correct;
This looks much better 👍 |
|
||
{{"demo": "../breadcrumbs/PageContainerBasic.js", "height": 400, "hideToolbar": true}} | ||
{{"demo": "../breadcrumbs/PageContainerBasic.js", "height": 400, "defaultExpanded": false}} |
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.
Should this be the same as the breadcrumbs page?
{{"demo": "../breadcrumbs/PageContainerBasic.js", "height": 400, "defaultExpanded": false}} | |
{{"demo": "../breadcrumbs/PageContainerBasic.js", "height": 400, "bg": "inline", "defaultExpanded": false}} |
|
||
The [DashboardLayout](https://mui.com/toolpad/core/react-dashboard-layout/) component from `@toolpad/core` is the starting point for dashboarding applications. It takes care of application layout, theming, navigation, and more. An example usage of this component: | ||
|
||
{{"demo": "DashboardLayoutBasic.js", "height": 400, "iframe": true, "hideToolbar": true}} | ||
{{"demo": "DashboardLayoutBasic.js", "height": 400, "iframe": true, "defaultExpanded": false}} |
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.
Should this also do bg: 'inline'
?
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.
Just one last suggestion
https://deploy-preview-43796--material-ui.netlify.app/material-ui/react-dialog/#usedialogs |
A remnant of when the demo had |
Closes mui/toolpad#4007
Previews: