← Components / Input

Text field

Single-line text input with the M3 floating label.

SwiftUIReact Native · Coming soonFlutter · Coming soon
NameAda Lovelace
Emailyou@example.com

Usage

SwiftUI
M3ETextField("Email", text: $email, variant: .outlined, supportingText: "We never share it",
             leadingIcon: "mail")
M3ETextField("Password", text: $pw, error: pw.count < 8 ? "Too short" : nil, secure: true)

API

PropertySwiftUIDescription
variant.filled .outlinedStyle.
errorerror: String?Shows the error state and message.
countermaxLength:Character counter.

Guidelines

  • Use one style per form.
  • Explain errors in plain words and how to fix them.