Number Field

A number input with stepper buttons, formatting and a draggable label.

Installation

  1. Add the registryOnce per project
  2. Add number-field

Usage

A FieldLabel in the same Field names the input. Without a visible label, give NumberFieldInput an aria-label.

Composition

Examples

Formatting

format takes Intl.NumberFormat options, for decimals, percentages or units.

$

Scrub area

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

px

Large

Set size="lg" on the group for a taller field.

$

Disabled

Read-only

Invalid

Set invalid on the Field and explain the problem with a FieldError.

Props

The tables leave out className, style and render. Parts built on Base UI take them as its styling and composition guides describe.

NumberField

NumberFieldGroup

NumberFieldInput

NumberFieldDecrement

NumberFieldIncrement

NumberFieldScrubArea