Skip to main content
  1. Docs
  2. Components
  3. Forms

Form

Fields that check themselves on submit, server errors by name, and a summary of what to fix.

Import
@qeetrix/react/experimental
Status
ExperimentalSince 0.0.6
Renders
<form>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

When to use

Use it for
  • Any form that's submitted: invite, settings, setup.
  • Errors from the server, shown on their fields.
  • Long forms, where the summary says what's wrong at once.
Not for
  • A setting that saves as it's switchedSwitch
  • A search boxInput

02

Anatomy

  1. 1error-summary<div>At the top: a danger alert (role="alert") inside, its title a heading; it takes focus.
  2. 2error-summary-list<ul>Each problem, in the fields' order, linked to its control.
  3. 3field-error<div>The same words, on the field itself.

03

Do and don't

The same words twice
DoThe summary repeats the field's error exactly, and links to it.
Don'tA vague banner, and the errors only on the fields.

04

Content

  • The summary's title says what to do: "Fix these to continue".
  • Each item is worded exactly as its field's error.
  • Errors say how to fix it, with an example.
Next — FormAPI