inputs/DSSecureField
DSSecureField
inputsPassword input with a show/hide toggle. Shares the same visual language as DSTextField.
iOS 17+macOS 14+
Purpose
Use for all password and sensitive data entry. Never use a plain DSTextField for passwords.
States
hidden
Password masked with dots (default).
visible
Plain text, toggled by the eye icon.
focused
Primary-colour border.
error
Red border with an error message.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | String? | nil | Label above the field. |
| placeholder | String | "" | Placeholder text. |
| textreq | Binding<String> | — | Binding to the password value. |
| hint | String? | nil | Helper text (e.g. password rules). |
| error | String? | nil | Validation error message. |
| isDisabled | Bool | false | Disables the field. |
Examples
Login form
Email + password pair.
swift
DSTextField(label: "Email", placeholder: "you@example.com", text: $email)
DSSecureField(label: "Password", placeholder: "••••••••", text: $password, error: passwordError)Usage Guidelines
- Always provide a 'Forgot password?' link near this field.
- Never log or print the bound value.