Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
React Native docs
FormsReact Native

Number field

Edit localized numeric drafts with exact decimal steps and inclusive bounds.

Public APILumenNumberFieldReact Native

Native example

Use Number field

Preserve the raw localized String draft, including unfinished sign or decimal input. Grouping and exponent notation are unsupported. Keep currency, units, required validation, and submission parsing application-owned.

View captured React Native example
Number field rendered in the Expo web renderer Lumen playground
Captured exampleExpo web renderer
tsx
import { useState } from 'react'
import { LumenNumberField } from '@santi020k/lumen-react-native'

export function Quantity() {
  const [draft, setDraft] = useState('1')
  return <LumenNumberField label="Quantity" value={draft} onValueChange={setDraft}
    min="0" max="10" step="0.5" locale="en-US"
    incrementLabel="Increase quantity" decrementLabel="Decrease quantity" />
}

Reference

Public API

The primary shared and platform-specific options exposed by LumenNumberField.

APIValues or typeDefaultDescription
labelstringRequiredNames the numeric field.
value / onValueChangestring / (string) => voidRequiredRetains raw localized drafts; invalid drafts remain editable.
min / max / stepstringundefined / undefined / 1Uses exact decimal strings for inclusive bounds and positive steps.
localestringundefinedSelects accepted decimal separator and digits.
incrementLabel / decrementLabelstringIncrease value / Decrease valueNames step actions.
invalidNumberLabel / outOfRangeLabelstringEnter a valid number / Enter a number within the allowed rangeLocalizes draft validation.
showStepperbooleantrueShows step actions.
ref / TextInput propsLumenTextInputRef / TextInputPropsundefinedForwards input focus and supported native options.
description / errorMessagestringundefinedProvides localized supporting copy or host validation.
enabled / readOnlybooleantrue / falseBlocks changes without clearing controlled state.

Native behavior

Design and accessibility

When to use it

Preserve the raw localized String draft, including unfinished sign or decimal input. Grouping and exponent notation are unsupported. Keep currency, units, required validation, and submission parsing application-owned.

Accessibility

Labels the editable numeric draft and step actions, exposes invalid or out-of-range context, and disables unavailable or read-only steps.

Shared component

Available on other platforms

Apple / SwiftUIAndroid / Compose
React Native docsNative primitives