InputNumber
Controlled numeric field with increment/decrement controls, optional bounds, decimal precision, repeat stepping, and numeric accessibility semantics.
InputNumber is controlled-only.
Usage
const [quantity, setQuantity] = useState(1);
<InputNumber value={quantity} onValueChange={setQuantity} />Bounds
There are no implicit min/max bounds.
<InputNumber
value={quantity}
onValueChange={setQuantity}
min={1}
max={10}
/>When supplied, bounds must be finite and form a valid range.
Step and decimal precision
step defaults to 1.
<InputNumber
value={price}
onValueChange={setPrice}
step={0.25}
decimals={2}
/>decimals={undefined} means integer-only normalization/display. Decimal steps require decimal support at the configured precision.
Keyboard editing
InputNumber distinguishes a valid semantic number from temporary editing text.
Intermediate strings such as an empty value, sign-only value, or trailing decimal separator can exist while editing without emitting an invalid semantic number.
On blur, ARCUI normalizes/clamps valid text and restores invalid or empty editing text from the external controlled value.
Step controls
Increment/decrement controls request value ± step and stop at supplied bounds.
Press-and-hold repeat stepping is a semantic interaction timer; it is not used as an animation frame driver.
Presentation
The decrement and increment buttons can use independent Button types:
<InputNumber
value={value}
onValueChange={setValue}
decrementButtonType="border"
incrementButtonType="solid"
/>Both default to "border".
valueType controls the resting numeric surface:
border | transparentDefault: border.
shape is shared by the step controls and value surface:
square | rounded | circleDefault: rounded.
Native surface
InputNumber exposes selected native TextInputProps that do not conflict with numeric ownership. ARCUI owns numeric value, parsing, editing normalization, editability, font scaling, placeholder behavior, and accessibility-value semantics.
Testing
Use testID where the public component contract exposes it so application tests can target the ARCUI-owned root without depending on visual implementation details. Component-specific stable descendants may use documented suffixes.
For provider setup and the dedicated react-native-arc-ui/testing entrypoint, see Testing.
API Reference
Also inherits: TextInputProps
| Prop | Type | Default | Description |
|---|---|---|---|
| ref? | Ref<TextInput> | — | React 19 ref-as-prop. |
| value | number | required | Controlled numeric value. |
| onValueChange | (value: number) => void | required | Called whenever ARCUI resolves a new valid semantic numeric value. |
| min? | number | — | Optional lower bound. No lower bound is applied when omitted. |
| max? | number | — | Optional upper bound. No upper bound is applied when omitted. |
| step? | number | 1 | Amount applied by increment/decrement controls. Must be greater than zero. |
| decimals? | number | — | Number of decimal places used for numeric normalization and display. undefined means integer-only. |
| label? | string | — | — |
| error? | string | — | — |
| disabled? | boolean | false | Fully disabled semantic state. |
| active? | boolean | true | Whether the control is active in the current interaction flow. |
| decrementButtonType? | TInputNumberButtonType | "border" | Visual type of the decrement button. |
| incrementButtonType? | TInputNumberButtonType | "border" | Visual type of the increment button. |
| valueType? | TInputNumberValueType | "border" | Resting presentation of the numeric value surface. transparent still exposes focused/error semantic feedback. |
| shape? | TInputNumberButtonShape | "rounded" | Shape language shared by both step controls and the numeric surface. |
| style? | StyleProp<ViewStyle> | — | Root component style. |
| inputStyle? | StyleProp<TextStyle> | — | Native numeric TextInput style. ARCUI-owned font size and semantic color retain final precedence. |
| decrementAccessibilityLabel? | string | — | Optional accessibility override for the decrement action. Falls back to the localized ARCUI decrement-action label. |
| decrementAccessibilityHint? | string | — | — |
| incrementAccessibilityLabel? | string | — | Optional accessibility override for the increment action. Falls back to the localized ARCUI increment-action label. |
| incrementAccessibilityHint? | string | — | — |
| accessibilityValue? | Pick<AccessibilityValue, "text"> | — | Accessibility representation of the current numeric value. InputNumber intentionally exposes only textual accessibility values because React Native's numeric accessibility range values are integer-based while InputNumber supports decimals. Consumer text overrides ARCUI's formatted numeric value. |
| testID? | string | — | — |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
The generated table above covers ARCUI-owned public props from the source-aligned type snapshot. Native inherited surfaces remain available where the public type extends React Native props.
Motion
Field modifier motion follows ARCUI input behavior. Long-press repeat stepping is intentionally a semantic JS timer, not an animation frame loop.
See Motion for the library-wide model.
Performance
Keep application semantics at normal React update cadence. ARCUI components avoid using React state as a frame-by-frame animation driver; use the component callbacks and let Reanimated own continuous visual work.
See Performance for broader guidance.
Accessibility
ARCUI supplies localized default labels for decrement and increment actions.
Applications may override them and add hints:
<InputNumber
value={quantity}
onValueChange={setQuantity}
decrementAccessibilityLabel="Remove one item"
incrementAccessibilityLabel="Add one item"
/>Because InputNumber supports decimals while React Native numeric accessibility range values are integer-oriented, its public accessibilityValue override intentionally accepts only { text }. ARCUI otherwise exposes the formatted numeric value.
See Accessibility for the library-wide model.
Theming
This component resolves its normal presentation from ARCUI tokens and active theme context. Prefer token configuration for system-wide design changes and component props for genuine instance-level exceptions.
Relevant token areas include:
colors.*.inputNumber
sizings.inputNumber
typography.inputNumber
button
animationsTop-level token overrides are shallow. Compose changed built-in namespaces from defaultTokens rather than relying on recursive merge behavior.
Try it live
Open the existing React Native Snack to explore InputNumber interactively.