Design System
Forms

Quantity toggle

A numeric stepper for small counted quantities such as claim line items or dependant counts. Arrow keys step, and values clamp to min and max.

Purpose

Use it for small whole numbers a person adjusts a step at a time. For a wide range where the rough magnitude matters more than the exact figure, use Slider.

Example

States

The bound buttons disable themselves: Decrease at min, Increase at max. The value itself can never leave the range — every change, typed or stepped, is clamped.

Structure

PropertyValue
Buttons40px square (size-10), 18px remove / add glyphs
Value field48px wide (w-12), 14px medium, tabular-nums
Border1px --input, with internal 1px dividers
Radius--radius-md (6px)
Shadow--shadow-1
Focus2px --ring on the focused segment
Disabled50% opacity container · bound buttons at 40% opacity

Best practices

Do

  • Use it for small counts (roughly 0–20) where stepping is faster than typing.
  • Set min and max to the real business limits — the clamp is the validation.
  • Give each control a meaningful label ("Dependants"), not the default "Quantity".

Don't

  • Use it for arbitrary numbers — that is an Input with inputMode="numeric".
  • Use it for a wide range where precision does not matter — that is Slider's job.
  • Pair it with a separate error message for out-of-range values — the control cannot produce one.

Accessibility & keyboard

  • The container is a role="group" named by the label prop; the value field is a role="spinbutton" carrying aria-valuenow, aria-valuemin and aria-valuemax, so screen readers announce both the value and its range.
  • The stepper buttons carry aria-label="Decrease" and aria-label="Increase" and disable at the bounds, which is announced.
  • Typed input is parsed and clamped to [min, max]; clearing the field resets it to min.
  • Keyboard: ArrowUp steps up and ArrowDown steps down by step, clamped at the bounds; Tab moves between the three segments; digits can be typed directly into the value field.

Props

PropTypeDefaultDescription
valuenumber | undefined—Controlled value.
defaultValuenumber | undefinedminUncontrolled initial value.
onValueChange((value: number) => void) | undefined——
minnumber | undefined0—
maxnumber | undefined99—
stepnumber | undefined1—
disabledboolean | undefined——
labelstring | undefined"Quantity"Accessible name for the control group.

On this page