Skip to content

NumberInput

stable

Numeric input with currency formatting, min/max/step clamping, stepper buttons, and Intl.NumberFormat

Data EntryInteractive/Storybook ↗
import { NumberInput } from "@danagraph/design-system"
Loading demo…

Props

value
Type number | nullDefault —

Controlled numeric value

onChange
Type (value: number | null) => voidDefault —

Value change handler

min
Type numberDefault —

Minimum allowed value

max
Type numberDefault —

Maximum allowed value

step
Type numberDefault 1

Increment/decrement step

locale
Type stringDefault "en-US"

Locale for Intl.NumberFormat

currency
Type stringDefault —

ISO 4217 currency code for formatting

showStepper
Type booleanDefault false

Show increment/decrement buttons

label
Type stringDefault —

Input label

error
Type stringDefault —

Error message

hint
Type stringDefault —

Help text

Accessibility

  • Uses inputMode="decimal" for mobile numeric keyboard
  • ArrowUp/ArrowDown keyboard support for increment/decrement
  • aria-valuemin, aria-valuemax, aria-valuenow for range semantics
  • Label association via htmlFor/id
  • Error state announced via aria-describedby + aria-invalid
smmdlgsemantictypeinputborderfin
Design Rationale

This component was designed to express:

Explore Related

Was this helpful?