UnderlinePanels
The UnderlinePanels are used to break related content into tabbed panels.
Page navigation navigation
The Underline panels component implements the tabs pattern and are made of the following ARIA roles: * tablist:
the container wrapping the tabs * tab: each individual tab * tabpanel: the container wrapping the content
associated with each tab
Accessibility and usability expectations
Presentation
Cognition
- Each
UnderlinePanels.Tabmust have a clear and descriptive label that concisely conveys the content of the associated panel
Vision
UnderlinePanels.Tabs must have sufficient color contrast against the background, including the selected tab which must be visually obvious to users with low visionUnderlinePanels.Tabs must have a visible focus style with a minimum contrast ratio of 3:1 against the background- The loading state (a pulsating oval) must have a minimum contrast ratio of 3:1. Currently, it lacks sufficient color contrast and does not meet WCAG 1.4.1 Non-text Contrast
Mobility
- Each
UnderlinePanels.Tabmust have a minimum target size of 24 by 24 CSS pixels to support users with motor impairments
Adaptability
UnderlinePanels.Tab's must remain readable and not require horizontal scrolling, at a viewport size of 320 by 256 CSS pixels- Text resizing and spacing adjustments must be supported without loss of readability or function
Interaction
- Only one
UnderlinePanels.Tabcan be selected at a time - Pressing the
UnderlinePanels.Tabkey moves focus to the selectedUnderlinePanels.Tab, and pressing it again moves focus into the visible panel - The left and right arrow keys move focus between
UnderlinePanels.Tab's, automatically activating and displaying their associated panels
Keyboard
UnderlinePanels.Tab's must be operable with theUnderlinePanels.Tabkey for focus, and with the left and right arrow keys for navigation- Activation of
UnderlinePanels.Tab's happens automatically on focus, not requiring an extra keystroke - Only one
UnderlinePanels.Tabcan be selected at a time and is reachable using theUnderlinePanels.Tabkey - Pressing the
UnderlinePanels.Tabkey when aUnderlinePanels.Tabhas focus moves focus to the visible panel - The right and left arrow keys are used to navigate between
UnderlinePanels.Tab's - The
UnderlinePanels.Tab's are automatically activated and their panel is displayed when they receive focus
Engineering for AT Compatibility
Screen reader
- The component uses ARIA roles:
tablist(container),UnderlinePanels.Tab(individual tab), andtabpanel - The
tablistmust have an accessible name viaaria-labelledbyoraria-label - The active
UnderlinePanels.Tabmust usearia-selectedto indicate its state - Icons in
UnderlinePanels.Tab's are hidden from screen readers when decorative. If icons convey information, the adjacent text must be sufficient to convey the meaning - The loading state must have a text alternative. It currently does not have a text alternative, so screen reader users receive no feedback and this fails WCAG 1.1.1 Non-text Content
- If a
UnderlinePanels.Tabincludes a counter, the counter must be included in the accessible name so screen reader users are aware of it
Speech recognition
- Each
UnderlinePanels.Tablabel should be included in the accessible name so that speech recognition users can activate aUnderlinePanels.Tabby speaking its visible label - Avoid using duplicate or overly generic
UnderlinePanels.Tablabels (e.g., "Tab 1", "Tab 2") to ensure accurate voice control
Built-in accessibility features
- The component handles all roles, the selected state and all aspects of keyboard interaction
UnderlinePanelshas anaria-labelandaria-labelledbyprop to provide an accessible name for thetablist- The counter text is included in the accessible name of the
UnderlinePanels.Tab - The
UnderlinePanels.Tablabels and focus style meets minimum color contrast requirements - The selected
UnderlinePanels.Tabis visually obvious to users with low vision. Whilst the underline of a selectedUnderlinePanels.Tabdoes not meet contrast requirements, the label of the selectedUnderlinePanels.Tabis bold and has higher contrast than the non-selected labels, which ensures users with low vision can distinguish the selectedUnderlinePanels.Tab - The
UnderlinePanels.Tab's have a target size larger than the 24 by 24 CSS pixels minimum
Keyboard navigation
| Key(s) | Description |
|---|---|
| Enter or Space | Activates the focused tab. |
| Tab | When focus moves into the tab list, focus goes to the active tab. When the tab list contains focus, moves focus to the next element in the page tab sequence outside the tablist. |
| Arrow Left | Moves focus to the previous tab. If focus is on the first tab, focus moves to the last tab. The focused tab is activated. |
| Arrow Right | Moves focus to the next tab. If focus is on the last tab, focus moves to the first tab. The focused tab is activated. |
| Home | Moves focus to the first tab and activates it. |
| End | Moves focus to the last tab and activates it. |
Implementation requirements
- Provide an accessible name for the component. If there is a visible label, use
aria-labelledbyto associate it with the element that hasrole="tablist", otherwise usearia-labelwith an appropriate value. The accessible name describes the purpose or intent of the component and distinguishes the component from other components on the page. Don't use thearia-labeltext to provide a hint for how to use the component - Provide a clear and descriptive label for each
UnderlinePanels.Tab - Only use decorative icons in
UnderlinePanels.Tabs as a text description cannot be set - Ensure the component does not cause horizontal scrolling. If there are too many
UnderlinePanels.Tabs or theUnderlinePanels.Tablabels are too long, the component causes horizontal scrolling when zoomed or viewed at a width equivalent to 320 CSS pixels, which fails WCAG 1.4.10 Reflow - Avoid using the
loadingCountersuntil accessibility issues have been resolved
How to test the component
Integration tests
- The
tablisthas an appropriate and descriptive accessible name - Each
tabhas an appropriate and descriptive label - If an icon is present within a
tab, the adjacent text inside of thetabprovides all the necessary information without relying on the icon itself - The component does not cause horizontal scrolling when zoomed or viewed at a width equivalent to 320 CSS pixels
Component tests
- The container wrapping the
tab's has a roletablistand can acceptaria-labelandaria-labelledbyattributes - Each individual
tabhas a role ofUnderlinePanels.Tab - The container wrapping the content associated with each
UnderlinePanels.Tabhas a role oftabpanel - The active
UnderlinePanels.Tabis conveyed to assistive technologies using thearia-selectedattribute - Each
UnderlinePanels.Tabmust have a minimum target size of 24 by 24 CSS pixels - The
UnderlinePanels.Tablabels have sufficient color contrast against the background - The selected
UnderlinePanels.Tabis visually obvious to users with low vision - Only one
UnderlinePanels.Tabcan be selected at a time and is reachable using theUnderlinePanels.Tabkey - Pressing the
UnderlinePanels.Tabkey when aUnderlinePanels.Tabhas focus moves focus to the visible panel - The right and left arrow keys are used to navigate between
UnderlinePanels.Tabs - The
UnderlinePanels.Tabs are automatically activated and their panel is displayed when they receive focus