On this page

Number field

Keys, what Number field gives you and what your team does.

Conformance

Number field meets WCAG 2.2 level AA when used as described on these pages. It follows the Spinbutton pattern of the WAI-ARIA Authoring Practices.

Keyboard

Key Action
Tab Moves focus to the field. The step buttons are skipped.
↑ ↓ Step up or down by step.
Page Up Page Down Step by ten steps.
Home End Go to min or max.
Enter Checks and formats the typed value.

What Number field gives you

  • role="spinbutton" on the input with aria-valuenow, aria-valuemin and aria-valuemax.
  • Step buttons with names (“Decrease”, “Increase”) that turn grey and stop at the limits; every button action also has a key.
  • The text-field focus: the edge turns color.border.focus with a 2 px inset ring of the same colour.
  • Step buttons respond to at least 24 × 24 px.

What your team does

  • Name it with a <label for> on the field’s id (the id prop of NumberField).
  • Translate the button names with aria-label on a Vietnamese page.
  • Put the unit in the label when the format doesn’t show it.
  • Explain errors in text with aria-invalid and aria-describedby.

WCAG criteria

Criterion Level How
1.3.1 Info and Relationships A Label linked with for
2.1.1 Keyboard A Keys for every button action
2.4.7 Focus Visible AA Text-field focus
2.5.8 Target Size (Minimum) AA Step buttons 24 × 24 px
3.3.1 Error Identification A aria-invalid plus an error message
4.1.2 Name, Role, Value A spinbutton with its value and limits