Skip to content

NumberField

NumberField

<NumberField label="Quantity" defaultValue={1} minValue={0} maxValue={99} />
<NumberField
label="Budget"
defaultValue={1000}
formatOptions={{ style: 'currency', currency: 'USD' }}
minValue={0}
step={50}
/>

Install: @helixui/core

import { NumberField } from '@helixui/core'

status: stable · since: 0.2.0

Tags: number, input, stepper, numeric

Anatomy

Label
[ 1,234 ][−][+]
Description / error

Layout

  • displayblock
  • widthfill
  • heightcontent
  • intrinsicSizefills width, hugs height
  • stackabletrue
  • fullBleedfalse

Visual

A text input formatted as a number with optional +/- steppers on the right. Locale-aware parsing (commas vs dots) and validation against min/max/step.

Props

NameTypeDefaultDescription
labelReactNodeVisible label.
descriptionReactNodeHelper text.
errorMessagestring | (v: ValidationResult) => stringError text.
size'sm' | 'md' | 'lg'mdControl height.
steppersbooleantrueShow +/- buttons inside the group.
minValuenumberMinimum allowed value.
maxValuenumberMaximum allowed value.
stepnumber1Step amount per +/- click.
formatOptionsIntl.NumberFormatOptionsLocale formatting (currency, percent, units).

Tokens used

color.bg.surface.default, color.bg.surface.muted, color.bg.action.neutral.default, color.border.default, color.border.focus, color.border.danger, color.text.primary, color.text.secondary, color.text.action.danger, radius.md, space.2, space.3, font.family.sans, font.size.sm, font.size.md, font.size.lg, font.weight.medium

Accessibility

Notes

  • Built on react-aria-components NumberField — locale-aware parsing/formatting and ARIA spinbutton semantics.
  • Pass formatOptions (Intl.NumberFormatOptions) for currency, percent, or unit-formatted inputs.

Composes with

ComponentRelationNote
FieldwrapsNumberField has built-in label/description/error like other RAC inputs.
FormparentSubmitted as part of a Form.
TextInputsibling
Slidersibling

Prompt examples

These are the AI prompt → JSX mappings used by the helixui prompt DSL and integrations like Cursor / Claude Code.

quantity input

“number input with min 0 max 99”

<NumberField label="Qty" minValue={0} maxValue={99} value={qty} onChange={setQty} />