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

[DashboardLayout] Allow custom navigation page items #4809

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

apedroferreira
Copy link
Member

@apedroferreira apedroferreira commented Mar 27, 2025

Closes #4413.
Closes #4607 both for the hidden and disabled cases.

Helps with #4748 as it allows for overriding the Link component used by each item.
Also helps with #4733 but additional state management would be needed from the user, so maybe there is a better solution for that in the future.

Also makes it possible to easily mark items as expanded, selected or disabled, or use external links with a custom href.

Check the new documentation here:

renovate bot and others added 2 commits March 27, 2025 14:02
…e component for it
@apedroferreira apedroferreira added enhancement This is not a bug, nor a new feature scope: toolpad-core Abbreviated to "core" component: layout This is the name of the generic UI component, not the React module! labels Mar 27, 2025
@apedroferreira apedroferreira self-assigned this Mar 27, 2025
@mui-bot
Copy link

mui-bot commented Mar 27, 2025

Netlify deploy preview

https://deploy-preview-4809--mui-toolpad-docs.netlify.app/

Generated by 🚫 dangerJS against 926d1e4

@apedroferreira apedroferreira changed the title Custom navigation items [DashboardLayout] Allow custom navigation page items Mar 27, 2025
@davorian
Copy link

I'm awaiting this!!!

@apedroferreira apedroferreira requested a review from a team April 1, 2025 14:33
@apedroferreira apedroferreira marked this pull request as ready for review April 1, 2025 14:33
@@ -0,0 +1,31 @@
{
"props": {
Copy link
Member

Choose a reason for hiding this comment

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

🤔 I would have expect this to just have a item prop. Does it need all these other props? This is just to render the default item right? I'm not sure we should expose more API on it.

Copy link
Member Author

@apedroferreira apedroferreira Apr 2, 2025

Choose a reason for hiding this comment

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

If you look at the expanded demo here I was just trying to make this type of changes as easy as possible as well as reusing the existing component. Some of these are things that some users already asked to be able to override.

Would it help if these props were additional options maybe? And the first parameter was the item?

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! enhancement This is not a bug, nor a new feature scope: toolpad-core Abbreviated to "core"
Projects
None yet
4 participants