- Docs
- Components
- Forms
Password input
A password or a secret, with Show password. Paste always works, and there's no length cap.
- Import
- @qeetrix/react/experimental
- Status
- ExperimentalSince 0.0.4
- Renders
<input type="password">Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// Experimental: from the package's experimental entry, until it's stable.
import { PasswordInput } from "@qeetrix/react/experimental";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
autoComplete | "current-password" | "new-password" | "off" | — | Sign in, create one, or a secret that isn't theirs: so managers fill or suggest. |
visible · defaultVisible · onVisibleChange | boolean | false | Whether it shows as text; hidden to start: people may not be alone. |
capsLockWarning | boolean | true | "Caps Lock is on" while typing with it on. |
endAdornment | ReactNode | — | Before Show password: a Copy button for a secret. |
messages | Partial<…passwordInput> | — | Its words, over QeetrixProvider's. |
… Input's props | | — | Everything Input takes, but type. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
input-control | <input> | The input: Input's parts throughout. |
password-input-caps | <span> | "Caps Lock is on", at the box's end, while it is. |
04
A new password
new-password and the rule; it hides again when the form submits.
<Field label="New password" description="At least 12 characters." name="password">
<PasswordInput autoComplete="new-password" minLength={12} required />
</Field>