When to use it
Load secrets on demand with loadValue and hide them after a delay. The mask never shows the value length.
Show a masked value, such as an API key, with show, hide, and copy actions.
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
Load secrets on demand with loadValue and hide them after a delay. The mask never shows the value length.
import LumenUI
import SwiftUI
struct ApiKeyField: View {
let loadKey: @MainActor () async throws -> String
@State private var loadFailed = false
var body: some View {
LumenSecretValue("Sandbox API key", loadValue: loadKey, autoHideAfter: 30,
onLoadError: { _ in loadFailed = true })
}
}Reference
The primary shared and platform-specific options exposed by LumenSecretValue.
| API | Values or type | Default | Description |
|---|---|---|---|
| label / value or loadValue / autoHideAfter | field name / secret or loader / auto-hide delay | required / required / never | Load secrets on demand with loadValue and hide them after a delay. |
Native behavior
Load secrets on demand with loadValue and hide them after a delay. The mask never shows the value length.
The toggle exposes expanded state, and loading, hiding, and copy results are announced.
Shared component