Text Field

iOS 16.4+iPadOS 16.4+

Displays a single-line text input.

FLXTextField example
import SwiftUIstruct TextFieldUsageExample: View {    @State private var email = ""    var body: some View {        FLXFieldLabel("Email") {            FLXTextField("you@example.com", text: $email)        }        .padding(FLXSpacing.xl)    }}

Installation

Requires the design system foundation (tokens and theme).

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

Usage

FLXTextField("Email", text: $email)

Custom styling

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

API Reference

FLXTextField

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

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