Put PasswordFieldInput and PasswordFieldToggle in PasswordField, inside a Field. Pass autoComplete="new-password" on a sign-up form.
The sample also uses Field. One command adds them with this item:
sign-in-password.tsx
PasswordField
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| rounded | "default""full" | — | |
| size | "default""lg""sm""xs" | — | |
| variant | "dashed""default" | — | |
| class | string | — | |
| visible | boolean | — | Shows the password as text (controlled). |
| default | boolean | false | Shows the password as text at first (uncontrolled). Default false. |
| on | — | Runs when the toggle, a form submit, or a page hide changes visible. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
PasswordFieldInput
<input>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| rounded | "default""full" | — | |
| size | "default""lg""sm""xs" | — | |
From Base UIInputBase UI docs | |||
| on | — | Callback fired when the value changes. Use when controlled. | |
| default | string | number | readonly string[] | — | The default value of the input. Use when uncontrolled. |
| value | string | number | readonly string[] | — | The value of the input. Use when controlled. |
| ...props | <input> attributes | — | Every other attribute goes to the <input>, with a ref. |
PasswordFieldToggle
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| size | "icon-sm""icon-xs""sm""xs" | — | |||||
| rounded | "default""full" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| label | string | "Show password" | The name of the toggle. Default "Show password". It does not change with the state. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
PasswordFieldCapsLock
<output>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <output> attributes | — | Every other attribute goes to the <output>, with a ref. |
| EnterorSpace | On PasswordFieldToggle: shows or hides the password. Focus stays on the toggle. |
|---|
Built with
Installs with Password Field
- Components
- Input Group





