Skip to content

Number Input

Last updated 11 Nov 2026

NbNumberInput is a numeric field with built-in stepper buttons (− and +). It shares the same design language as NbTextInput and NbSelect, with default and fluid variants.

What the component guarantees ​

  • A native number field. It renders <input type="number"> with min, max and step, so a reader announces it as a spin button and the arrow keys step it natively.
  • A label tied to the field through for and the field's id.
  • Validation a reader hears. With error, the field carries aria-invalid="true" and aria-describedby points at the visible message by its id ({id}-error, {id}-warning, {id}-helper). A message present on first render is read on focus and not announced on load; one that appears or changes later mounts with role="alert" (error) or role="status" (warning). The status icon inside the field repeats the message for sighted users and is aria-hidden, so a reader hears it once.
  • Named steppers. The − and + buttons are ghost, icon-only NbButtons named "Decrease" and "Increase" through their label, which is also their tooltip, and they do not take focus from the field on a mouse press. They are out of the tab order, as in Carbon: the arrow keys on the field already step the value, so a keyboard user loses nothing and skips two stops per field. At min or max the stepper that cannot go further is drawn disabled.
  • Text a phone will not zoom, at least 16px on a phone touch screen.
  • Tested in tests/NumberInput.test.ts and tests/fieldValidationAria.test.ts, and by axe in tests/axe.test.ts.

Keyboard ​

KeyAction
↑ ↓Steps the value by step (the browser's own)
EnterCommits the typed value (the field blurs)
TabMoves to the steppers, then out

What you own ​

  • A label. Without label the field has no name.
  • Units. "Seats" or "Price (EUR)" in the label; a unit drawn only beside the field is not read with it.
  • Error text that says the range, "Between 1 and 50", rather than "Invalid".

Known gaps ​

  • Enter blurs the field to commit it, so focus leaves the field. A keyboard user presses Shift+Tab to return.
  • No manual screen reader pass has been recorded for this component.