Skip to contentKino
Skip to Content

Number field

A number field with a stepper on each side, whose digits roll up or down when the value is stepped.

npx shadcn add https://kinoui.com/r/number-field.json
Share on

Examples

Default

Step it with the buttons, the arrow keys or the wheel and its digits roll; typing never rolls.

Shift steps by 5%.

Format

format takes Intl.NumberFormat options, and Shift steps by largeStep. For money, use the Money input.

Drag the label sideways to change it.

Scrub area

Wrap the label in NumberFieldScrubArea to change the value by dragging it.

Installation

npx shadcn@latest add https://kinoui.com/r/number-field.json
Files
lib/refs.tslib/reduce-motion.tscomponents/kino/input.tsxlib/resize.tslib/roll.tsxcomponents/kino/number-field.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

NumberField

PropTypeDefaultDescription
defaultValuenumberNoneThe value at first, when you leave the state to the field.
valuenumbernullNoneThe value, when you hold the state.
onValueChange(value, details) => voidNoneCalled when the value changes; details.reason says how.
minnumberNoneThe lowest value.
maxnumberNoneThe highest value.
stepnumber1How far a step goes.
largeStepnumber10How far a step goes with Shift, or Page Up and Page Down.
formatIntl.NumberFormatOptionsNoneHow the value is written, such as a currency or a percent.

Accessibility

  • The input is a spin button: the arrow keys step it, Shift with them steps by largeStep, and Home and End go to min and max.
  • A stepper turns off at the limit it can’t pass.
  • The rolling digits are drawn over the input for the eye only; screen readers read the input’s value.
  • When the system asks for less motion, the digits only crossfade.