Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Android docs
FormsAndroid

Number field

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

Public APILumenNumberFieldAndroid / Compose

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.

Number field rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulator
kotlin
LumenNumberField(
    label = "Quantity",
    value = quantityDraft,
    onValueChange = { quantityDraft = it },
    min = java.math.BigDecimal.ZERO,
    max = java.math.BigDecimal.TEN,
    step = java.math.BigDecimal("0.5")
)

Reference

Public API

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

APIValues or typeDefaultDescription
labelStringRequiredNames the numeric field.
value / onValueChangeString / (String) -> UnitRequiredControls raw localized ungrouped input; drafts beyond 128 characters are invalid.
modifierModifierModifierApplies layout to the field and step actions.
min / maxjava.math.BigDecimal?nullInclusive exact decimal bounds; minimum must not exceed maximum.
stepjava.math.BigDecimalBigDecimal.ONEPositive exact increment; precision and scale are bounded to 128.
localejava.util.LocaleLocale.getDefault()Selects accepted decimal separator and displayed digits.
description / errorMessageString?nullShows supporting text; supplied errors take priority over draft validation.
invalidNumberLabel / outOfRangeLabelStringEnter a valid number / Enter a number within the allowed rangeLocalizes draft and bound errors.
incrementLabel / decrementLabelStringIncrease value / Decrease valueNames step actions.
showStepperBooleantrueShows optional increment and decrement actions.
enabled / readOnlyBooleantrue / falseControls edits and steps without discarding the current value.

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

React NativeApple / SwiftUI
Android docsCompose module