Responsive tabs and accessible alternatives #3508
-
Hi! Porting this over from a related discussion (#2223) as requested 😄 We have some... not great behavior with tabs on mobile views, even with say 5 tabs and relatively short titles:
A couple ideas we have are to make the tabs bar scrollable, similar to a pattern I found in the MUI library. I have a rudimentary version working (sans auto-scrolling as the user navigates with left/right arrow keys, etc, but the scrolling potential is there) as seen here: scrollable-tabs.movWe've also tossed around the notion of rendering a select/combobox component at mobile breakpoints (similar to how we're rendering a menu as opposed to the side-by-side table of contents on tablet/mobile), which I see you suggested! My question there is, how would we approach implementing that while also keeping accessibility in mind? Would it be accessible to have a structure like this, and leverage the Tabs state hook + Select events to manage which is selected? <Tabs>
<Select /> // Might be outside of the Tabs, ignore the bad pseudocode
<TabPanels>
...
</TabPanels>
</Tabs> I think I understand how to do this and make it work, but I'm concerned that the pattern may not make sense to a reader, especially one using assistive technology. Any help would be much appreciated 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @stern-shawn, Sorry for the delay here, we were discussing it internally. If this is a blocker right now, I would recommend using a select dropdown on smaller resolutions to unblock you. I've made a ticket for us to consider building an overflow UI for tab lists, which includes arrow buttons. Unfortunately our timeline isn't clear for when this feature will drop, but I've made the ticket and will report back when we have some updates for you. |
Beta Was this translation helpful? Give feedback.
This update for this was done in PR #4067 and will be available once #4096 is merged.