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.
Edit localized numeric drafts with exact decimal steps and inclusive bounds.
Apple availability
Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.
Native example
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.
import LumenUI
import SwiftUI
struct Quantity: View {
@State private var draft = "1"
var body: some View {
LumenNumberField("Quantity", text: $draft, min: "0", max: "10", step: "0.5",
incrementLabel: "Increase quantity", decrementLabel: "Decrease quantity")
.environment(\.locale, Locale(identifier: "en_US"))
}
}Reference
The primary shared and platform-specific options exposed by LumenNumberField.
| API | Values or type | Default | Description |
|---|---|---|---|
| _ label / text | String / Binding<String> | Required | Names the field and retains raw localized drafts. |
| min / max / step | String? / String? / String | nil / nil / 1 | Uses exact decimal strings; the application owns units and submission parsing. |
| incrementLabel / decrementLabel | String | Increase value / Decrease value | Names step actions. |
| invalidNumberLabel / outOfRangeLabel | String | Enter a valid number / Enter a number within the allowed range | Localizes draft validation. |
| showStepper | Bool | true | Shows step actions. |
| focused | FocusState<Bool>.Binding? | nil | Connects application-owned input focus. |
| .environment(\.locale, ...) | Locale | Environment | Selects decimal separator and displayed digits. |
| description / errorMessage | String? | nil | Provides localized supporting copy or host validation. |
| readOnly / .disabled(...) | Bool | false | Blocks editing; disabled state comes from the SwiftUI environment. |
Native behavior
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.
Labels the editable numeric draft and step actions, exposes invalid or out-of-range context, and disables unavailable or read-only steps.
Shared component