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

DropdownMenu: Render in a sheet/drawer on small viewports #57228

Open
Tracked by #50459
jameskoster opened this issue Dec 19, 2023 · 4 comments
Open
Tracked by #50459

DropdownMenu: Render in a sheet/drawer on small viewports #57228

jameskoster opened this issue Dec 19, 2023 · 4 comments
Labels
Design System Issues related to the system of combining components according to best practices. Needs Design Feedback Needs general design feedback. [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

As dropdown menus with flyouts become more prevalent we should think about the UX on small screens in more detail. While it is generally best to optimise for fewer flyouts, the upper limits remain worthy of consideration. Moreover, even two-level menus – like the one we find in data view options – struggle to fit on small screens:

Dropdown

One potential solution would be to surface menus in a sheet/drawer, with dedicated controls to close the menu, or move up through its structure:

Dropdown

cc @ciampo.

@jameskoster jameskoster added [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. [Package] Components /packages/components labels Dec 19, 2023
@ciampo
Copy link
Contributor

ciampo commented Dec 19, 2023

In terms of UX, I think this option makes a lot of sense.

I'm not sure how easy it would be to adaptDropdownMenu implementation to it, especially nested submenus.

@diegohaz , I believe we were already discussing having UIs fall back to drawers a few years ago. Does ariakit provide any similar functionality? In case it doesn't, do you think it would still be feasible? We'd be happy to help where possible.

@diegohaz
Copy link
Member

@diegohaz , I believe we were already discussing having UIs fall back to drawers a few years ago. Does ariakit provide any similar functionality? In case it doesn't, do you think it would still be feasible? We'd be happy to help where possible.

Yes, it's possible to do that through the updatePosition callback. Responsive Popover serves as an example.

However, I've changed my mind about turning popovers into modals on mobile being beneficial for UX. This is just a personal viewpoint, but it seems companies like Apple are in agreement since they've also reverted their trays back to positioned dropdown popovers.

Submenus do add complexity, but I'd explore a solution similar to the Sliding Menu.

@jameskoster
Copy link
Contributor Author

I see trade-offs either way (drawer vs. sliding menu), but either would be an upgrade on infinitely stacking submenus that consume the entire screen :D If the Sliding Menu approach is simpler in terms of implementation then maybe we try that first?

@diegohaz
Copy link
Member

Also, if it helps, an easy way to prevent submenus from getting cut off on smaller screens is to use the overlap prop.

@jasmussen jasmussen added the Design System Issues related to the system of combining components according to best practices. label Sep 24, 2024
@auareyou auareyou moved this to Inbox 📥 in Design systems — Backlog Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design System Issues related to the system of combining components according to best practices. Needs Design Feedback Needs general design feedback. [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
Status: 🔦 Needs triage
Development

No branches or pull requests

4 participants