Components · Form Controls

Input & Form Field

A field for one line of text.

Automated a11y scan passing Element: <input>

Component Workbench

Switch between the live interactive preview, syntax-highlighted implementation code, copyable AI coding agent prompt, and designer anatomy blueprint.

Input & Form Field · Canonical Spec

Lowercase letters, numbers, and hyphens only.

When to use it

Do

  • Keep a visible label above every field.
  • Explain how to fix errors, not only that something is wrong.

Don't

  • Use placeholder text as the label.
  • Show an error before people have finished typing.

Accessibility & Keyboard Interaction

Requirements for using this component accessibly, following the W3C ARIA Authoring Practices Guide.

Interaction / KeyBehavior & Compliance Requirement
Explicit LabelingDirect for="id" linkage guarantees screen reader announcement.
Error AssociationWhen invalid, aria-describedby prioritizes the error ID before helper ID.
Aria InvalidSets aria-invalid="true" dynamically upon validation failure.

Tokens

Values update with the current theme.

RoleTokenCurrent value
Corner Radius--as-radius-sm
Surface--as-semantic-color-surface-canvas
Focus Glow--as-semantic-color-border-focus
Esc
↑↓ navigateEnter openEsc close