Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Android docs
FormsAndroid

Text field

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

Public APILumenTextFieldAndroid / Compose

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 Android phone emulator Lumen playground
Verified runtime captureAndroid phone emulator
kotlin
LumenTextField(
    value = email,
    onValueChange = { email = it },
    label = "Email address"
)

Reference

Public API

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

APIValues or typeDefaultDescription
valueBound StringRequiredStores the current native input value.
onValueChangeValue callback / bindingRequiredUpdates application state.
labelStringRequiredNames the field.
sizesm · md · lgmdSelects shared control metrics.
errorBooleanfalseApplies the semantic invalid treatment.
enabledBooleantrueControls 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 NativeApple / SwiftUI
Android docsCompose module