Secure Field

iOS 16.4+iPadOS 16.4+

Displays an obscured text input for passwords and other sensitive text.

FLXSecureField example
import SwiftUIstruct SecureFieldUsageExample: View {    @State private var password = "supersecret"    var body: some View {        FLXFieldLabel("Password") {            FLXSecureField("Password", text: $password)        }        .padding(FLXSpacing.xl)    }}

Installation

Requires the design system foundation (tokens and theme).

pnpm dlx shadcn@latest add https://swiftui.flexnative.com/r/ios-secure-field.json

Usage

FLXSecureField("Password", text: $password)

SecureField is a separate native control from TextField: it hides typed characters, blocks cut/copy, and is hidden in iOS screenshots.

Custom styling

TextFieldStyle doesn't support custom conformances, so there's no FLXSecureFieldStyle or override.

API Reference

FLXSecureField

init(    _ titleKey: LocalizedStringResource = "",    text: Binding<String>)init<S: StringProtocol>(    _ title: S,    text: Binding<String>)

For more information about FLXSecureField props, see the Apple documentation.