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

[toolpad-core] Add support for external links in dashboard navigation #4413

Open
l-astro opened this issue Nov 14, 2024 · 4 comments
Open

[toolpad-core] Add support for external links in dashboard navigation #4413

l-astro opened this issue Nov 14, 2024 · 4 comments
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" waiting for 👍 Waiting for upvotes

Comments

@l-astro
Copy link

l-astro commented Nov 14, 2024

Summary

It would be great to include support for external links in the navigation component; perhaps add a new NavigationExternal type to be added to NavigationItem?

Examples

No response

Motivation

We have several services that are as yet outside of the mui framework but the user needs visibility of them in the dashboard nav. We would like these to be nested under a single item e.g., ExternalServices > ExternalService1, ExternalService2... Currently the breadcrumbs gets muddled if these external href are child items, as the NAVIGATION expects a segment property and concatenates this string to the href.

Search keywords: navigation, routing, external link

@l-astro l-astro added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 14, 2024
@bharatkashyap bharatkashyap added waiting for 👍 Waiting for upvotes enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 14, 2024
@prakhargupta1 prakhargupta1 changed the title Add support for external links in dashboard navigation [toolpad-core] Add support for external links in dashboard navigation Nov 18, 2024
@prakhargupta1 prakhargupta1 added the scope: toolpad-core Abbreviated to "core" label Nov 18, 2024
@apedroferreira
Copy link
Member

apedroferreira commented Nov 18, 2024

Sounds like a useful feature!
We could add something like a path or href property to navigation page items, where any path supported by a typical href attribute could be used as a string. This property would take priority over segments.

@Janpot
Copy link
Member

Janpot commented Nov 18, 2024

Or alternatively, a renderItem prop to open up more options of customization, analog to DataGrid renderCell.

@prakhargupta1 prakhargupta1 added the component: layout This is the name of the generic UI component, not the React module! label Nov 25, 2024
@SamuelLeapifai
Copy link

I'd like to vote for the render props approach. Right now we can use only 3 kinds of navigation items: header, divider and a regular item. Would be great to allow for more options.

In our case, we'd like to display loader/spinner and 2 versions of headers (larger and smaller header). Currently there isn't even an option to provide classname to do css magic. Custom render prop would allow for many more features.

One more prop that would be useful is active: boolean | () => boolean. For custom routes that don't leverage segments to define if the menu item is active or not, we'd like to provide our own logic. This could perhaps also be solved with the render prop above.

@apedroferreira
Copy link
Member

I'd like to vote for the render props approach. Right now we can use only 3 kinds of navigation items: header, divider and a regular item. Would be great to allow for more options.

In our case, we'd like to display loader/spinner and 2 versions of headers (larger and smaller header). Currently there isn't even an option to provide classname to do css magic. Custom render prop would allow for many more features.

One more prop that would be useful is active: boolean | () => boolean. For custom routes that don't leverage segments to define if the menu item is active or not, we'd like to provide our own logic. This could perhaps also be solved with the render prop above.

Got it, makes sense, we can go with just a renderItem for now.
About the active prop, maybe renderItem would cover that use case for now? But feel free to let us know more specifically what you'd try to do with it and we can consider it if it makes sense.

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" waiting for 👍 Waiting for upvotes
Projects
Status: Backlog
Development

No branches or pull requests

6 participants