fndn/ui

Guides

Accessibility

The floor every screen and component stands on: keyboard patterns, names and roles, contrast ratios. Behaviour with real keyboard and focus logic comes from Ark UI (Zag.js underneath), so the keyboard model, the ARIA wiring and the DOM are the same in React, Vue and Svelte; docs <name> names the machine a component runs on, and building on Ark is in docs authoring (Behaviour).

Simple controls keep native semantics: a <button> is a button, a disclosure is a button with aria-expanded, a switch is button[role="switch"] with aria-checked.

Keyboard patterns

The keys each kind of control answers. A component's own list is in docs <name>.

PatternKeys
Button, icon buttonEnter, Space.
SwitchSpace, Enter toggle.
Disclosure (a thinking trace, a task row, a tool run)Enter, Space toggle; focus stays on the trigger, which points at its region (aria-controls).
Segmented control, radio groupOne tab stop. Arrow keys move and select, Home / End jump.
Checkbox groupEach box is a tab stop; Space toggles.
TabsOne tab stop. Arrow keys move and select (selection follows focus), Home / End jump.
ListboxOne tab stop. ArrowDown / ArrowUp move the highlight, Home / End jump, typing jumps to a match, Enter or Space choose.
Combobox, searchFocus stays in the field. Typing filters, ArrowDown / ArrowUp move the highlight, Home / End jump, Enter chooses. Escape closes a combobox's list and clears a search.
SelectEnter, Space, ArrowDown or ArrowUp open; arrows move; type-ahead; Enter or Space select; Escape closes and returns focus to the trigger.
MenuEnter, Space or ArrowDown open; arrows move; type-ahead; Enter or Space activate; Escape closes and returns focus to the trigger.
TooltipShows on focus and hover; Escape hides it. Never holds anything interactive.
PopoverFocus moves in (to the first focusable, else the surface); Escape closes and returns focus to the trigger.
Hover cardOpens on focus; Escape closes; focus stays on the trigger. Anything essential in it is reachable another way.
DialogFocus moves in and is trapped; Escape closes; focus returns to the trigger; the page behind is inert.
Table of toggleable rowsOne tab stop; ArrowDown / ArrowUp move between rows, Home / End jump; Enter / Space toggle.

What the keyboard changes is instant, with one exception: docs motion (Choreography).

Names, roles, announcements

  • Every icon-only control has an accessible name (aria-label). A Tooltip shows that name to sighted pointer users and does not replace it; when to add one: docs design (Controls).
  • Decorative icons and marks are aria-hidden="true".
  • Status that changes while the user waits (a thinking label, a loading state, a task's status) sits in a role="status" region. Streaming text is not announced word by word; announce it when it completes.
  • A group of related controls has a group role and a label (role="radiogroup" with aria-label).
  • Form controls are wired to their label and hint (for and id, aria-describedby, aria-invalid).

Contrast

At least 4.5:1 for body text, 3:1 for large text and control boundaries, in both themes. Which ink is for what is in docs design (Ink and colour): text read for meaning is at least ink-2, which passes on every surface; ink-3 does not, so it never carries meaning. Measured (WCAG ratio):

Inkpagecanvasinsetsurfacefieldhoverhover-2
ink-2 light5.605.225.515.855.225.364.80
ink-2 dark7.457.356.856.525.875.955.37
ink-3 light2.612.432.562.722.432.502.24
ink-3 dark3.523.483.243.082.772.812.54

Disabled text is exempt. A placeholder is ink-3, so it never stands in for a label or a hint.

Also required

  • Zoom and width: works at 200% zoom and at 320px wide without losing content or function.
  • Right-to-left: how to turn it on, and the logical utilities it needs: docs design (Type).
  • Forced colours: state is never colour alone (docs design, Ink and colour), and the focus ring is an outline, which forced-colours mode keeps (docs interaction, Focus).
  • Reduced motion: honoured through the tokens, see docs motion (Reduced motion).