Your privacy choices

We use necessary cookies, and others only if you allow them. You can change your mind at any time.

Feature · Accessibility

Accessibility

What accessibility asks of an interface, in plain words, and how Fancy Dev Kit answers it in the components themselves, so an app built from them starts from accessible parts instead of retrofitting them.

React

What this page covers

The Web Content Accessibility Guidelines (WCAG) 2.2 are the standard most accessibility law points at. Level A is the floor, AA is what most policies require, and AAA goes further. Each lesson below names the criteria it is about.

Contrast and theme tokens

Text and control outlines you can see, measured live.

Focus and the keyboard

Everything reachable without a mouse, with focus you can follow.

Language and direction

Labels that tell a screen reader which language they are in.

Target sizes

Controls big enough to hit, measured live.

Codes, autofill and status

One-time codes from a text message, and changes announced aloud.

Agents and consent

Where an AI agent may never act for a person.

Contrast and theme tokens

WCAG 1.4.3 Contrast (Minimum) (AA)WCAG 1.4.11 Non-text Contrast (AA)

The principle

Text must stand out from what is behind it: at least 4.5:1 for normal text. The outline that shows where a field is, and an icon that is a control, need 3:1. Contrast is a ratio from 1:1 (no difference) to 21:1 (black on white).

Low contrast fails people with low vision first, and everyone reading a screen in bright light.

How Fancy Dev Kit does it

  • Every form-control outline reads one token, --fancy-border-strong, now zinc-500 by default: 4.83:1 on white and 3.44:1 on the dark field (react-fancy 6.15.0). Before, outlines were 1.27:1 to 1.59:1.
  • Native checkboxes and radios are drawn by the browser; react-fancy sets their checked colour with accent-color and gives them a dark color-scheme in dark mode (6.15.1).
  • Readable secondary text uses --fancy-text-muted, 4.83:1 light and 6.75:1 dark on the default surfaces. The fainter token is kept for decoration only, and a scan test fails any new readable use of it (6.12.0, 6.13.0).
  • Secondary greys are theme tokens with -dark twins, so an app that remaps them restyles the kit (6.12.0). If you set them, the contrast is yours to check. Muted text is AA, not AAA; map --fancy-text-muted for 7:1.
Contrast, measured in your browserLive · measured

Muted text, for hints and secondary labels.

Measured in your browserRatioNeedsResult

The ratios are computed from the colours your browser rendered, with the WCAG formula. Switch the site between light and dark: the table re-measures.

Focus and the keyboard

WCAG 2.1.1 Keyboard (A)WCAG 2.4.3 Focus Order (A)WCAG 2.4.7 Focus Visible (AA)WCAG 2.4.11 Focus Not Obscured (Minimum) (AA)

The principle

Everything you can do with a mouse must work from a keyboard alone, in a sensible order, and you must always be able to see where focus is. People who use a keyboard, a switch or a screen reader depend on it.

A modal dialog is where focus should be held: inside it until it closes, then back where it started.

How Fancy Dev Kit does it

  • Button shows its focus ring on keyboard focus (:focus-visible) in the focus token, not after every mouse click (react-fancy 6.1.0).
  • Modal, Drawer and Command move focus in, keep Tab and Shift+Tab inside, close on Escape and return focus to the trigger (6.11.0).
  • ReorderableGrid is one tab stop: Space or Enter picks a cell up, the arrow keys move it, Escape cancels (5.64.0).
  • A fixed consent banner publishes the space it covers, so a page can keep focused controls clear of it. See Compliance.
Tab through, then open the dialogLive
Focus is onthe page (nothing focused)

Use Tab and Shift+Tab. The readout is the element that has focus right now, read from the page.

Language and direction

WCAG 3.1.1 Language of Page (A)WCAG 3.1.2 Language of Parts (AA)

The principle

A screen reader picks its voice and pronunciation from the language the page declares. Text in another language, such as a language switcher that names each language in itself, must say so, or it is read with the wrong rules and is hard to understand.

Right-to-left scripts such as Arabic also need their direction marked, so they display in the right order.

How Fancy Dev Kit does it

  • Options take their own lang and dir: Select (native and listbox), Autocomplete, RadioGroup, CheckboxGroup and MultiSwitch put them on the element holding the label (react-fancy 6.13.0).
  • An option that sets neither renders exactly as before, and dir="auto" is never added for you.
  • OtpInput's cells and PhoneInput's number stay left to right on a right-to-left page, where digits belong (PhoneInput since 6.10.0).
  • Visible strings such as Modal.Header's close label and OtpInput's cell names can be replaced, so they can be translated (6.11.0, 6.14.0).
A language switcher that names each language in itselfLive
The chosen option, as rendered<option lang="">

Pick a language. The readout is the chosen option's own attributes, read from the rendered page.

Target sizes

WCAG 2.5.8 Target Size (Minimum) (AA)WCAG 2.5.5 Target Size (Enhanced) (AAA)

The principle

Something you tap or click must be big enough to hit: at least 24 by 24 CSS pixels for AA, 44 by 44 for AAA. Small targets fail people with tremors, people on a moving bus, and everyone on a phone.

How Fancy Dev Kit does it

  • Modal.Header and Drawer.Header close buttons have a 44px hit area, without changing how they look (react-fancy 6.11.0).
  • QrCodePanel's actions default to size lg, 44px tall (6.8.0), and PhoneInput's targets are 44px (6.10.0).
  • The consent banner and dialog keep every target at 44px or more (fancy-compliance-ui).
  • Button sizes run xs to xl; the table measures what each renders, so you can pick the one your target needs.
Button sizes, measuredLive · measured
Button sizeRendered boxAA, 24pxAAA, 44px

Each box is read from the rendered button in your browser.

One-time codes and autofill

WCAG 1.3.5 Identify Input Purpose (AA)WCAG 3.3.8 Accessible Authentication (Minimum) (AA)

The principle

A field should say what it is for, so the browser and assistive tools can fill it in. Signing in must not depend on remembering or retyping something: pasting and autofill have to work, which matters most to people with memory or motor disabilities.

How Fancy Dev Kit does it

  • OtpInput's first cell has autocomplete="one-time-code", so iOS and Android offer the code from a text message (react-fancy 6.14.0).
  • A whole code arriving in one cell, from autofill, an IME or a paste, is spread across the cells instead of being cut to one digit (6.14.0).
  • The cells sit in one named group, and each is named "Digit 1 of 6" and so on, replaceable through labels (6.14.0).
  • Pasting fills the cells and strips anything that is not a digit.
A one-time code fieldLive

Enter the code we sent you

none autocomplete, first cellnone autocomplete, other cellsempty value

Paste a code such as 123456 into any cell.

Status messages a screen reader hears

WCAG 4.1.3 Status Messages (AA)

The principle

When something changes without moving focus, such as an item moved, a copy done or a check finished, a screen-reader user has to be told. A live region is the part of a page the screen reader reads out when it changes; polite ones wait for a pause, assertive ones speak at once.

How Fancy Dev Kit does it

  • ReorderableGrid announces every step of a keyboard move in an assertive live region, with every message replaceable (react-fancy 5.64.0).
  • SetupWizard announces copy results in a polite live region, and QrCodePanel says what each action did in a polite status (6.14.0, 6.8.0).
  • fancy-captcha-ui announces proof-of-work progress at quarter steps rather than every percent, and fancy-fun-lab-ui's XP feed folds a burst into one summary.
Reorder with the keyboard, and hear itLive
Plan
Build
Test
Ship
Press Space or Enter to pick up. Use the arrow keys to move, Space or Enter to drop, Escape to cancel.
What a screen reader hears

Nothing yet. Tab to a step, press Space, move it with the arrow keys, press Space again.

The list mirrors the component's own live region, so you can read what is spoken.

Agents and consent

Not a WCAG criterion: a Fancy Dev Kit rule

The principle

Fancy Dev Kit lets AI agents act in an interface beside the person. Some actions must stay the person's own: a consent choice made by an agent is not consent, and an approval card does not change that, because the click would still be the agent's.

How Fancy Dev Kit does it

  • Any element marked data-agent-off-limits fences everything inside it from agents: agent-integrations 0.58.0 refuses a click, field set, submit, focus or scroll that would reach inside.
  • The refusal comes before a pendingMode confirm, so no person is ever shown an approval card for it.
  • The agent learns only that the area exists and its role, such as "consent region": no labels, no values, no handles.
  • fancy-compliance-ui marks its banner, dialog and trigger, so consent is fenced in every app that uses it.

Watch an agent try the consent banner on the Compliance page

How it fits

Accessibility is not a separate package: it is built into react-fancy, so every Fancy Dev Kit surface built on it inherits it, from the consent banner to the captcha.

Install

  1. react-fancyReact
    npm install @particle-academy/react-fancy

The packages

Build on components that already do this

Start with react-fancy, then see the consent banner and captcha, which are built on it and held to AAA where they can be.