Accessibility
Accessibility standards
The accessibility rules every component meets, checked by the build or by review.
Standards
| Standard | Applies to | Stingray |
|---|---|---|
| WCAG 2.2 (W3C, 2023) | The basis for the others. | AA for every component. AAA for small-text contrast (7:1), relaxed targets (44px) and the 2px focus ring (7:1). |
| Section 508 | US federal ICT. | Covered by WCAG AA. |
| EN 301 549 | EU public-sector procurement and the European Accessibility Act. | Covered by WCAG AA. |
| eMAG | Brazilian federal e-government. | Keyboard, contrast and labeling covered. Language and content are the product team's. |
Contrast
Every text, icon and boundary color is tested in both themes on every surface. The build fails if a pair drops below its target.
| Target | Applies to | WCAG |
|---|---|---|
| 7:1 | Text under 14px. Colored text steps reach 8.5:1 on white. | 1.4.6 (AAA) |
| 4.5:1 | Labels on filled buttons and solid fills, in every state. | 1.4.3 (AA) |
| 3:1 | Checkbox, radio and switch boundaries, status glyphs, severity bars, chart marks, and filled-button edges against the page. Text fields rest lighter, reaching 3:1 on hover and 7:1 on focus; for a resting 3:1, set --sg-input-border to --sg-color-border-control. | 1.4.11 (AA) |
| 7:1 | The focus ring, on every surface. | 2.4.13 asks 3:1 |
Check a pair
Test any two colors against the targets. The default is tertiary text on the selected row fill, the tightest text pair.
Keyboard
Everything works from the keyboard, in reading order, with no traps. Composite components are one tab stop with arrow keys inside.
| Component | Keys |
|---|---|
| Button, link | Enter activates. Space also activates a button. |
| Checkbox, switch | Space toggles. |
| Radio group, segmented control | Tab enters once; arrow keys move and select. |
| Select | Native: arrow keys, type-ahead, Enter or Space to open. |
| Tabs | Tab enters once. Left and Right move; Home and End jump; the panel follows. |
| Data grid | Arrow keys, Home, End, Page Up, Page Down, Space, Enter. Full model in Table and grid. |
| Filter | / focuses it from anywhere; Esc clears it. |
| Combobox | Typing filters. Down opens and moves; Enter picks; Esc closes the list, then clears. Focus stays in the field. |
| Command palette | Ctrl K or Cmd K opens. Typing filters, Up and Down move, Enter runs, Esc closes and returns focus. |
| Tree | One tab stop. Up and Down move; Right opens or steps in; Left closes or steps out; Home, End and type-ahead jump; Enter selects. |
| Filter chips | Each remove button is a tab stop. Delete removes the focused chip; focus moves to the next. |
| Accordion | Native: Enter or Space on a summary toggles it. |
| Menu | Opens from its button. Up, Down, Home, End and type-ahead move; Esc closes and returns focus; Tab closes. |
| Dialog | Tab stays inside; the page behind is inert. Esc closes and returns focus to the trigger. |
| Tooltip | Shows on focus. Esc dismisses. |
| Chart | Focus the chart; Left and Right move between categories and read every series. Esc hides the readout. "View as table" is a tab stop. |
| Toast | Action and dismiss buttons are tab stops. The timer pauses while focus is inside. |
Focus
| Rule | Detail |
|---|---|
| The ring | 2px solid ink outline, 2px offset, no layout shift. 7:1 or better on every surface, both themes. Never blue. |
| Packed items | Table cells, menu items, tabs and nav items draw it inset. |
| Forced colors | The system Highlight color. |
| Order and return | Tab order follows reading order. Dialogs return focus to their trigger, menus to their button. |
| Never removed | No outline: none. Sticky headers never hide focus (WCAG 2.4.11). |
| Skip link | First focusable element on every page; visible on focus. |
Target size
| Context | Size |
|---|---|
| Minimum anywhere (WCAG 2.5.8, AA) | 24px |
| Dense controls and rows | 28px |
| Standard controls and rows (default) | 36px |
| Relaxed controls, touch (WCAG 2.5.5, AAA) | 44px |
| Checkbox, radio and switch rows, label included | 24px tall |
Motion, time and flashing
- Transitions take at most 240ms; large panels such as drawers, 320ms. Nothing pulses, bounces or shimmers. Only live activity, such as typing or recording, loops.
- Reduced motion sets every duration to 0ms and stops the loader and running progress bars.
- Skeletons and busy labels wait 300ms, so a quick answer never flashes.
- Haptics follow the phone's own settings. Products also offer a switch to turn them off (
Stingray.haptics.set(false)). - Nothing flashes more than three times a second.
- Auto-dismissing toasts (info and success) pause under the pointer or focus and never carry information needed for a decision (WCAG 2.2.1).
- Live updates never move the element about to be activated and never steal focus.
Zoom, text spacing, forced colors, print
| Condition | Behavior |
|---|---|
| Larger text (WCAG 1.4.4) | All sizes, gaps and controls are in rem and scale with the browser text size. Try it on the Spacing page. |
| Reflow at 400% zoom (1.4.10) | Under 640px: one column, and tables scroll in their own region. Nothing else scrolls sideways. |
| Text spacing overrides (1.4.12) | Line heights at least 1.33, body copy 1.5. Containers size to content, so text never clips. |
| Forced colors (Windows high contrast) | Icons take the color of adjacent text; status glyphs, sort icons and separators use CanvasText. The primary button fill and focus ring use Highlight. Selection bars, tab indicators and meters are real elements, not box shadows. |
| Grayscale and color-blindness | Every status has a glyph, label and hue. Charts add a legend, direct labels, a table view and a texture fallback. |
| Light theme, tables expanded, chart textures on, link addresses shown, classification and provenance kept. |
Roles, names and announcements
| Component | Semantics |
|---|---|
| Button, link, field | Native elements. A label per input; help and errors via aria-describedby; aria-invalid on error; aria-busy while loading. |
| Icons | Decorative, aria-hidden. Icon-only controls get aria-label and a tooltip. |
| Status | A text label. The CSS glyph is outside the accessibility tree. |
| Severity | role="img" with a name such as "Severity: High". |
| Grid | role="grid" on a real table; aria-sort on headers; aria-selected on rows. Sort and filter results are announced once, politely. |
| Tabs | tablist, tab with aria-selected and aria-controls, tabpanel with aria-labelledby. |
| Dialog and menu | Native <dialog> opened modally, named by aria-labelledby. Menus: menu and menuitem, with aria-haspopup and aria-expanded on the button. |
| Toast and banners | A labelled "Notifications" region. status (polite) by default; alert only for errors and incidents. |
| Combobox and palette | role="combobox" on the field, listbox and option for results, aria-activedescendant for the active option. Result count announced politely. |
| Tree | tree, treeitem with aria-expanded and aria-selected, group for each branch. |
| Progress and skeleton | role="progressbar" with aria-valuetext in words; no value when indeterminate. Loading tables: aria-busy and one status message. |
| Meter and timers | role="meter" with minimum, maximum and current value. Countdowns are not live regions; state changes are announced once. |
| Chart | A group named by its title and description, a polite keyboard readout, and a table view with real headers. |
Testing
| Check | How | When |
|---|---|---|
| Token gates: contrast, gray, grid, hover, type, CSS hygiene, icons | node tools/build.mjs | Every build |
| Automated page checks | axe-core on every docs page, light and dark. | Every change |
| Keyboard walk | Main task of each page without a pointer. | Every release |
| Screen readers | NVDA with Firefox, JAWS with Chrome, VoiceOver with Safari. | Planned, per component |
| Zoom and text | 200% and 400% zoom (320px reflow); WCAG 1.4.12 text spacing. | Per component |
| Forced colors, grayscale, print | Emulate each; nothing is lost. | Per component |