Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FormsApple

Password field

Enter passwords with transient visibility and native credential autofill hints.

Public APILumenPasswordFieldApple / 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 Vision · visionOS 1+

Native example

Use Password field

Keep authentication and credential lifecycle in the application. Visibility is transient and never saved. Use newPassword for registration; provider autofill needs device configuration.

Password field rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulator
swift
import LumenUI
import SwiftUI

struct RegistrationPassword: View {
    @State private var password = ""
    var body: some View {
        LumenPasswordField("Password", text: $password,
            showLabel: "Show password", hideLabel: "Hide password", newPassword: true)
    }
}

Reference

Public API

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

APIValues or typeDefaultDescription
_ label / textString / Binding<String>RequiredNames and controls secure entry.
showLabel / hideLabelStringShow password / Hide passwordNames visibility actions; visibility clears on blur or editing becoming unavailable.
newPasswordBoolfalseSelects native registration autofill hints where supported.
description / errorMessageString?nilProvides localized supporting copy or host validation.
readOnly / .disabled(...)BoolfalseBlocks editing; disabled state comes from the SwiftUI environment.

Native behavior

Design and accessibility

When to use it

Keep authentication and credential lifecycle in the application. Visibility is transient and never saved. Use newPassword for registration; provider autofill needs device configuration.

Accessibility

Preserves password semantics and native autofill hints; labels visibility actions and hides on blur or disabled state.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package