TextFieldSize
public enum TextFieldSize
Represents the size of a text field, affecting both padding and font.
Use this enum to configure consistent spacing and typography for text fields across your application.
- Usage:
swift TextField("Name", text: $name) .textFieldSize(.medium)
Sizes are mapped to tokens defined in your Theme for consistent scaling.
-
A compact text field with smaller padding and font.
Declaration
Swift
case small -
The default size for standard input fields.
Declaration
Swift
case medium -
A large input field typically used in prominent UI sections.
Declaration
Swift
case large -
Returns the padding to apply based on the theme’s spacing tokens.
Declaration
Swift
public func padding(theme: Theme) -> EdgeInsetsParameters
themeThe theme to use for spacing values.
Return Value
EdgeInsets appropriate for the field size.
-
Returns the corresponding font from the theme based on field size.
Declaration
Swift
public func font(theme: Theme) -> FontParameters
themeThe theme to use for typography values.
Return Value
A
Fontappropriate for the field size.