sheengemologic ui
All components

NumberField

A locale-aware spinbutton with numeric app state, step controls, and native form submission.@gemologic/sheen · forms

Playground

<NumberField label="Budget" defaultValue={1250.5} min={0} step={0.5} formatOptions={{ style: "currency", currency: "USD" }} name="budget" />

Variant matrix

Localized amount

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/NumberField.tsx
Tokens
  • --sheen-color-bg-inset
  • --sheen-color-border-control
  • --sheen-color-focus-ring
  • --sheen-control-h-md

Accessibility

Role: spinbuttonKeyboard: ArrowUp, ArrowDown, PageUp, PageDown, Home, End

Do

  • Keep app state numeric and let the scoped locale format the display.

Do not

  • Do not parse the formatted visible input in form submit handlers; use the hidden raw value.

Generated props

NameTypeDefaultDescription
label *string—Required visible label.
valuenumber | null—Controlled numeric value; null presents an empty field.
defaultValuenumber | null—Initial uncontrolled numeric value; null starts empty.
onValueChange(value: number | null) => void—Receives a finite number, or null for an empty/partial value.
minnumber—Finite inclusive lower bound.
maxnumber—Finite inclusive upper bound.
stepnumber1Positive finite arrow and trigger increment.
largeStepnumber—Positive finite Page Up and Page Down increment; defaults to ten steps.
formatOptionsIntl.NumberFormatOptions—Intl number options evaluated with the effective scoped locale.
namestring—Native hidden-input form name.
formstring—ID of a form outside the component ancestry.
descriptionstring—Supporting text associated with the spinbutton.
errorstring—Validation text that marks the field invalid.
disabledbooleanfalseDisables input, triggers, focus, and submission.
readOnlybooleanfalsePrevents edits while retaining focus and submission.
requiredbooleanfalseMarks the native field required.
inputRefHTMLInputElement | ((element: HTMLInputElement) => void)—Receives the visible native input.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.