Skip to content
RivetUI

Number Field

Captures formatted numeric values with precise stepping, range constraints, and keyboard control.

@rivetui/number-field

Preview

Explore each composition interactively, then open its code in the same context.

Default

Adjust a constrained numeric value with buttons, arrow keys, or direct entry.

Formatted value

Use the native Intl number format options without changing the raw numeric value.

Note
Arrow keys change the value by $100. Hold Shift for $10 steps, or Alt for $0.10 steps.

Registry

Installation

Add the component source and its declared dependencies with the shadcn CLI.

Install component
bunx --bun shadcn@latest add @rivetui/number-field
Inspect registry item

Public interface

API reference

Component-specific props are listed here. Native element and Base UI props continue to pass through.

NumberField

PropTypeDefault
valuenumber | null—
defaultValuenumber—
onValueChange(value: number | null, details) => void—
onValueCommitted(value: number | null, details) => void—
minnumber—
maxnumber—
stepnumber | "any"1
smallStepnumber0.1
largeStepnumber10
formatIntl.NumberFormatOptions—
localeIntl.LocalesArgumentruntime locale
disabledbooleanfalse
readOnlybooleanfalse
requiredbooleanfalse
namestring—

NumberFieldLabel

Accepts native label props. Connect it to NumberFieldInput with matching htmlFor and id values.

NumberFieldGroup

Accepts Base UI group props and provides the shared border, focus, invalid, and disabled treatment.

NumberFieldInput

PropTypeDefault
idstring—
placeholderstring—
aria-labelstring—

NumberFieldDecrement

PropTypeDefault
aria-labelstring"Decrease value"

NumberFieldIncrement

PropTypeDefault
aria-labelstring"Increase value"
Rivet UI / Number FieldComponents engineered, not decorated.