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

Allow hiding the navigation bar and toggle button #4229

Closed
vikasgurjar opened this issue Oct 8, 2024 · 6 comments · Fixed by #4231
Closed

Allow hiding the navigation bar and toggle button #4229

vikasgurjar opened this issue Oct 8, 2024 · 6 comments · Fixed by #4231
Assignees
Labels
component: DashboardLayout enhancement This is not a bug, nor a new feature waiting for 👍 Waiting for upvotes

Comments

@vikasgurjar
Copy link
Contributor

vikasgurjar commented Oct 8, 2024

Summary

Allow hiding the navigation bar and toggle button in case we just want to show the header

Examples

No response

Motivation

In my app I want to use toolpad to handle navigation and header after a user logs in. But I have a case where user needs to wait before they are verified to see other pages, and on that page I just need the header.

I guess I can use the AppBar component from MUI but that would require me to handle account flow separately.

Search keywords: hide navigation

@vikasgurjar vikasgurjar added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 8, 2024
@Janpot Janpot added the waiting for 👍 Waiting for upvotes label Oct 8, 2024
@Janpot
Copy link
Member

Janpot commented Oct 8, 2024

As far as I can see, we could approach this in two different ways:

  1. Support a hideNavigation: boolean prop to hide the navigation surface
  2. Provide slots for each top-level surface (navigation, appBar) so that you can replace it with an empty component

any other ideas?

@Janpot Janpot added enhancement This is not a bug, nor a new feature component: DashboardLayout and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 8, 2024
@vikasgurjar
Copy link
Contributor Author

  1. Support a hideNavigation: boolean prop to hide the navigation surface

This should be straight forward. I can work on this and raise a PR too. I wanted to know other than the changes in the core package, test cases and docs update for the new prop, is there a need for example too?

@bharatkashyap
Copy link
Member

  1. Provide slots for each top-level surface (navigation, appBar) so that you can replace it with an empty component

This makes sense to me from a long-term reusability perspective - separating the drawer and appBar into separate slots which can be overriden

@apedroferreira
Copy link
Member

apedroferreira commented Oct 8, 2024

any other ideas?

We've talked about separating the components that make up the layout and exporting them, including the header and the sidebar. I guess that might also work?

This should be straight forward. I can work on this and raise a PR too. I wanted to know other than the changes in the core package, test cases and docs update for the new prop, is there a need for example too?

If we go for that solution I guess that should be enough, and as an example just maybe a small demo and paragraph in the docs.

@apedroferreira
Copy link
Member

apedroferreira commented Oct 8, 2024

On second thought the hideNavigation prop makes most sense for now as it can be used to hide the menu icon too besides the sidebar itself, which the other options wouldn't be able to do so elegantly.

Copy link

github-actions bot commented Oct 9, 2024

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@vikasgurjar How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: DashboardLayout enhancement This is not a bug, nor a new feature waiting for 👍 Waiting for upvotes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants