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 *stringRequired visible label.
valuenumber | nullControlled numeric value; null presents an empty field.
defaultValuenumber | nullInitial uncontrolled numeric value; null starts empty.
onValueChange(value: number | null) => voidReceives a finite number, or null for an empty/partial value.
minnumberFinite inclusive lower bound.
maxnumberFinite inclusive upper bound.
stepnumber1Positive finite arrow and trigger increment.
largeStepnumberPositive finite Page Up and Page Down increment; defaults to ten steps.
formatOptionsIntl.NumberFormatOptionsIntl number options evaluated with the effective scoped locale.
namestringNative hidden-input form name.
formstringID of a form outside the component ancestry.
descriptionstringSupporting text associated with the spinbutton.
errorstringValidation 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.