PasswordInput
import { PasswordInput } from '@tangible/ui';
Interactive docs and examples: PasswordInput in Storybook.
PasswordInput props
| Prop | Type | Default | Description |
|---|---|---|---|
purpose |
"current" | "new" |
current to sign in or confirm who you are; new to choose a password (sign up, reset, change). Sets autocomplete to current-password or new-password. |
|
className? |
string |
Additional class name applied to the root wrapper element. | |
defaultRevealed? |
boolean |
false |
Uncontrolled: start shown. |
inputClassName? |
string |
Class name applied directly to the <input> element. Use for utilities like tui-input-reset (removes browser-native search decoration, clear buttons, and spinners) that must target the input itself. |
|
labels? |
PasswordInputLabels |
||
onRevealChange? |
(revealed: boolean) => void |
Fires on the toggle, and with false when a native submit re-masks the field |
|
revealed? |
boolean |
Controlled: whether the password shows as text | |
size? |
"lg" | "md" | "sm" |
'md' |
Control size. |
Also accepts the standard attributes of InputHTMLAttributes (data-*, aria-*, event handlers), passed to the element it renders.
Other exports
defaultPasswordInputLabels:Required<PasswordInputLabels>
Examples
-
Invalid Field: Under
Field, the label, error and required state wire themselves, as on any text field. -
Disabled: The toggle is disabled with the field, so it leaves the Tab order too.
Other stories: Default, Sign In Form, New Password, Change Password, Controlled Reveal, Sizes (interactive page).
Component API tokens
Read via fallback, never declared. Set one on an ancestor to restyle every instance under it.
--tui-password-input-button-radius