Skip to content

Also available as Markdown

Data Input

NumberInput

Numeric field with increment and decrement steppers.

NumberInput

Numeric field with increment and decrement steppers. Built on React Aria NumberField with a stepper group for keyboard- and pointer-friendly adjustments. Prefer this over a plain text field when the value must stay numeric.

Examples

Default

Pass a label and seed with defaultValue (or control via value / onChange).

Demo.tsxtsx
import { NumberInput } from '@var-ui/react';

<NumberInput label="Quantity" defaultValue={1} />

Bounds and step

Clamp the range with minValue / maxValue and set step for how far each stepper click (or arrow key) moves.

Between 0 and 10

Demo.tsxtsx
import { NumberInput } from '@var-ui/react';

<NumberInput
  label="Quantity"
  defaultValue={1}
  minValue={0}
  maxValue={10}
  step={1}
  description="Between 0 and 10"
/>

Props

Accessibility

Built on React Aria NumberField. The increment and decrement controls expose aria-labels (“Increase” / “Decrease”). Pair with label, and use description / errorMessage so assistive tech gets the same help and validation copy as sighted users. Arrow keys adjust the value within any configured bounds.