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

Topbar navigation and shopping cart slot #4662

Open
rkristelijn opened this issue Feb 6, 2025 · 1 comment
Open

Topbar navigation and shopping cart slot #4662

rkristelijn opened this issue Feb 6, 2025 · 1 comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@rkristelijn
Copy link
Contributor

rkristelijn commented Feb 6, 2025

Summary

We would like to have a top navigation instead of a sidebar in DashBoardLayout. Currently, there is no dedicated slot for this, neither in DashBoardLayout nor in AppProvider.

Additionally, we would like to add a shopping cart icon next to the existing slot on the top right. How can we extend the layout to support more slots? Would it be preferable for us to submit a merge request?

Examples

Image

Image

Motivation

Motivation
1. Shopping cart placement – A shopping cart icon on the top right is a common design pattern for webshops.
2. Top navigation – Many webshops use a horizontal top menu. While the “hide navigation” option exists, it would be useful to toggle a top navigation instead of just hiding the sidebar.

Search keywords: topbar navigation, top menu, custom slots, shopping cart

@rkristelijn rkristelijn added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 6, 2025
@rkristelijn rkristelijn changed the title Topbar navigation Topbar navigation and shopping cart slot Feb 6, 2025
@apedroferreira
Copy link
Member

apedroferreira commented Feb 6, 2025

Hi, we have an issue for allowing navigation with tabs instead of sidebar in #4544.
But there's no timeline for when it might actually be prioritized and worked on...

As for the shopping cart item, it's maybe not the most elegant way and we could create an extra slot for actions on the right side, but you should be able to use something like:

import { Account } from '@toolpad/core/Account';

//...
slots={{ toolbarAccount: () => <><Account />{ /* your shopping cart button */ }</> }}
// ...

in the DashboardLayout component props.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants