Navigation
Tabs
Tabs switch between views of one thing without leaving the page, such as the payments, members and settings of a project.
In kanso-ui as Tabs
Accessibility
- Roles:
role="tablist"with a name (aria-label="Studio project");role="tab"on each button, witharia-selectedandaria-controls;role="tabpanel"on each panel, witharia-labelledbyandtabindex="0". Hide the other panels withhidden. - Keyboard: Tab lands on the selected tab only (the others have
tabindex="-1"). Left and Right arrows move to the previous or next tab and select it, wrapping at the ends; Home and End go to the first and the last. Tab again moves into the panel. - Targets: tabs are 48px tall (
size-control-lg) and as wide as their label. - Contrast: rest labels,
ink-mutedonpaper, 6.4:1 in light and 8.9:1 in dark; the selected label and the indicator,inkonpaper, 16.7:1 and 15.9:1; the focus ring, 7.3:1 and 9.0:1. - Motion: none; the indicator moves to the new tab at once.