NumberField
A wrapper around React Aria’s NumberField component. Provides keyboard-accessible
increment/decrement buttons and locale-aware number formatting.
Add via CLI
Section titled “Add via CLI”npx @a2ra/cli add number-fieldDisabled state
Section titled “Disabled state”With validation
Section titled “With validation”Example JSON
Section titled “Example JSON”{ "type": "NumberField", "props": { "label": "Quantity", "name": "qty", "minValue": 1, "maxValue": 100, "step": 1, "defaultValue": 1 }}| Prop | Type | Description |
|---|---|---|
label | string | Visible label |
placeholder | string | Placeholder text |
minValue | number | Minimum allowed value |
maxValue | number | Maximum allowed value |
step | number | Increment/decrement step |
value | number | Controlled value |
defaultValue | number | Uncontrolled default |
name | string | Form field name |
isRequired | truefalse default | Marks field as required |
isDisabled | truefalse default | Disables the input |
isReadOnly | truefalse default | Prevents editing |
isInvalid | truefalse default | Shows error styling |
isWheelDisabled | truefalse default | Prevents mouse wheel from changing the value |
validationBehavior | aria defaultnative | Validation reporting strategy |
description | string | Helper text |
errorMessage | string | Error text shown when isInvalid is true |
isWheelDisabled: trueis recommended in forms to prevent accidental value changes when the user scrolls the page.- The increment/decrement buttons are keyboard-accessible and ARIA-labelled automatically.