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.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
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.