Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FormsApple

Text field

Collect a single line of text using each platform’s native input and focus behavior.

Public APILumenTextFieldApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple TV · tvOS 16+Apple Vision · visionOS 1+Apple Watch · watchOS 9+

Native example

Use Text field

Keep a stable label even when placeholder text is present. Pair error styling with useful explanatory text rather than relying on color alone.

Text field rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenTextField(
    "Email address",
    text: $email
)

Reference

Public API

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

APIValues or typeDefaultDescription
textBound StringRequiredStores the current native input value.
BindingValue callback / bindingRequiredUpdates application state.
titleStringRequiredNames the field.
sizesm · md · lgmdSelects shared control metrics.
errorBooleanfalseApplies the semantic invalid treatment.
SwiftUI .disabledBooleanfalseControls native editing state.

Native behavior

Design and accessibility

When to use it

Keep a stable label even when placeholder text is present. Pair error styling with useful explanatory text rather than relying on color alone.

Accessibility

The field remains a native input with platform focus, keyboard, autofill, and screen-reader behavior. Errors use native invalid-state semantics where available.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package