Menus and tabs
How a 2nd level menu row condenses to icons with the current tab in full, with live examples and its accessibility.
Menu rows: condensing, and how to use them
The 2nd level menu is a row of links under the header. When the names do not fit it shows icons only, and the current tab keeps its name. The rule is the same for every row, so a phone, large text and a translation all get the same answer from the same measurement.
High contrast: choose High contrast in Display and read examples 2 to 6 again; the bar under the current tab, its name and the focus ring are all still there. Forced colours (Windows contrast themes): the filled background goes, so the current tab also gets a Highlight outline.
When it condenses
- The row is measured with the names showing. If its content is wider than its box, it becomes icons only (
.is-compact). It is never decided from the screen width, so a tablet, a small window, large text, wider spacing and a long translation each get the right answer. - It measures again whenever the row, a tab, the text size or the font changes: one
ResizeObserver, no timers. - If icons only is still too wide, the row scrolls sideways. It never wraps and never squeezes a tab under 44px.
What stays
- Every tab is at least 44px wide and as tall as the row (target size).
- The current tab and the tab with keyboard focus keep their name beside the icon. The other tabs show a tooltip on hover and on focus.
- The current tab is scrolled into view when the page opens and when the row changes size, but never while a person is scrolling it.
- A fade on the edge with more tabs says that the row scrolls.
How many tabs
- 6 or 7 tabs is the guide: they fit on a 375px phone at normal text, with the current name. 9 tabs always scroll on a phone (they need 396px before the name).
- Use fewer tabs by joining pages that belong together, with in-page links, before you add a control.
- More than about 14 tabs: use a select (
.selectwith a label) at phone width instead, because scrolling that far is slow.
Do
- Give each tab a short name: a noun, sentence case, no full stop (content design guide: "Backup/Logs", "Hours", "Alerts").
- Always give each tab a text name, even when only the icon shows. The name is in the page for screen readers and voice control.
- Keep the order the same on every page and in every language.
- Choose icons that stand for the thing (the icon table).
Do not
- Never put two tabs with the same icon, or the same name, in one row.
- Never hide the name of the current tab.
- Do not use the colour or the icon alone to say which tab is current: the bar, the name and (in forced colours) the outline say it too.
- Do not use these rows for panels inside one page: that is the tabs component (
role="tablist"). - Do not change the 1st level menu this way (the side menu example).
Icon changes in Starboard
| Tab | Was | Now | Why |
|---|---|---|---|
| Pictures (Settings, General) | eye | image | An eye means Show or Watch. |
| Tdarr (Settings, Apps) | film | cpu | Reelix has the film icon in the same row. |
| Updates (Settings, Updates) | sliders-horizontal | circle-arrow-up | It had the General icon. |
The side menu is not condensed this way
The side menu (the rail, and the phone slide-out) is vertical. It always shows the icon and the name, and it scrolls up and down, so it has no sideways overflow to solve. The level 1 row in the header keeps its older behaviour: icons only, no current name.
Accessibility of menu rows
Semantics, and why
- A
navlandmark with its own name (aria-label) holding links, andaria-current="page"on the current link. Notrole="tablist": every item is a link to another page, and the WAI-ARIA Authoring Practices say the tabs pattern is for panels in one page. Site navigation is a list of links (WCAG 1.3.1 info and relationships, 4.1.2 name, role, value). GOV.UK and the US Web Design System give the same advice. - The icon is
aria-hiddenand the name is always text in the page. When only the icon shows the name is clipped, not removed, so the link's accessible name is the same at every width (WCAG 2.5.3 label in name, 4.1.2).
What a screen reader says
- Expected from the markup (not run on every reader; the checklist says which): NVDA and JAWS: "Settings General, navigation landmark", then "General, link, current page" or "Hours, link". VoiceOver: "General, current page, link, 1 of 7". TalkBack: "General, current page, link". The tooltip is hidden from screen readers (
aria-hidden), so nothing is said twice. - Verified by running: the browser's accessibility tree for each example (role link, name = the text name,
current=pageon one link, landmark navigation named) in Chromium, at every width in this page. - Reading order is the visual order, left to right (right to left in a right-to-left language).
Keyboard
- Tab reaches every tab, one stop each (2.1.1, 2.4.3). The arrow keys, Home and End move between tabs as a convenience. Enter opens the page (Space does not, as for any link). There is no trap.
- Focus is visible: a ring at least 3px wide at 3:1 contrast against the row (2.4.7, 1.4.11). The tab with focus shows its name and is scrolled clear of the fade; a sticky header never covers it (2.4.11 focus not obscured).
- Focus stays on the same link when the row condenses or the text size changes: the row only changes classes; it never rebuilds its links.
Touch, zoom, colour and motion
- Every tab is 44px wide and tall; the row's targets do not overlap (2.5.8). No information is only on hover: the tooltip also shows on focus, and the current name is always visible.
- Reflow at 400% zoom and 320px: the row scrolls sideways, which is allowed for a toolbar of this kind, and the current tab stays in view (1.4.10). Text at 175% and wider text spacing change the measurement, not the result (1.4.4, 1.4.12).
- Forced colours and High contrast: the bar is
Highlight, the current tab also has an outline, and the fade is a mask, so it needs no colour. - Reduced motion: scrolling the current tab into view is an instant jump; nothing animates.
What we test
- Automated: axe in Light, Dark, High contrast and High contrast dark on this page; target size; the measured minimum tab at 320, 375, 430 and 768px at 100% and 175% text.
- Manual: Tab walk and arrow keys on a row of 9; focus after a width or text-size change; reading order; layout states (first, middle, last current).
- Not covered: a full pass with each screen reader on each system; the announcements in this section for JAWS, VoiceOver and TalkBack are expected, not run.
Standards: WCAG 2.2 (1.3.1, 1.4.4, 1.4.10, 1.4.11, 1.4.12, 2.1.1, 2.4.3, 2.4.7, 2.4.11, 2.5.3, 2.5.8, 4.1.2); WAI-ARIA Authoring Practices, Tabs and Navigation patterns; GOV.UK Design System, Service navigation.
Classes
.site-header__tabs,.menu-tabs,.is-compact,.menu-tabs__label,.can-scroll-start,.can-scroll-end