Skip to content

Forms

Field

Label, hint and error around one form control, wired for screen readers. The base of Input, Select and Textarea.

  • Experimental
  • No keyboard interaction
  • Screen reader not tested yet

Updated 2026-11-12

Playground

Change the props. The controls come from the documented props.

The first day of the project.

tsx
<Field label="Start date" hint="The first day of the project.">
  <input
    type="date"
    name="playground-start"
    className="h-input-height rounded-input border border-control px-4"
  />
</Field>

Usage

When to use

Use Field only to wrap a form control the system doesn't have yet, so it gets the same label, hint and error treatment as every other field. Report the missing control as a gap.

When not to use

  • Around Input, Select or Textarea: they already contain a Field.
  • For Checkbox and RadioGroup: they have their own label structure.

How it works

Field renders the label, the hint above the control and the error below it, and wires them up: the label points at the control, hint and error are linked with aria-describedby, and an error sets aria-invalid. optional adds “(optional)” to the label.

Content guidelines

Labels are short nouns. Hints say what a good answer looks like before people type. Errors say how to fix the problem, not only that there is one.

Do and don’t

Do
  • Use it only for a control the system doesn't have yet, and report that gap.
Don’t
  • Don't wrap Input, Select or Textarea in a Field; they already contain one.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. label14px medium; “(optional)” in text.secondary.
  2. hintAbove the control, so it is read before typing.
  3. input-fieldAny control, passed as the only child.
  4. error-messageIcon, “Error:” for screen readers, text in accent.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { Field } from "@/ds";

Around a native control

The first day of the project.

Props

Checked against the component's TypeScript type on every build.
Field props
NameTypeDefaultDescription
label (required)string–Visible label.
hintstring–Help text between label and control.
errorstring–Error message; sets aria-invalid on the control.
optionalbooleanfalseAdds “(optional)” to the label.
children (required)ReactElement–One control element; Field adds id, aria-describedby and aria-invalid.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by Field
TokenTierValueUtility
input.heightcomponent48px
input.radiuscomponent8px
accent.defaultsemantic#C6492E
border.controlsemantic#8A8578
spacing.2semantic8px
spacing.4semantic16px
text.primarysemantic#0A0A0B
text.secondarysemantic#555555
type.small.sizesemantic14px
weight.mediumsemantic500
weight.regularsemantic400

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Not applicable
Screen readerManualNot tested yet

Semantics and focus

  • <label for> points at the control; hint and error are linked with aria-describedby.
  • Errors carry an icon and text, never colour alone.