Password input
A password field with a button that shows or hides what was typed. The caret stays where it was, and the password hides again when its form is sent.
npx shadcn add https://kinoui.com/r/password-input.jsonCopy install command
Examples
Default
Show the password, then sign in: it hides again as the form is sent, so the browser never saves it as text.
New password
Use new-password so a password manager offers a strong one, and give each toggle on the page its own toggleLabel. A Password strength under the box shows how strong it is.
Controlled
Own visible to show two fields together.
Installation
Copy code
npx shadcn@latest add https://kinoui.com/r/password-input.json- Files
lib/refs.tslib/reduce-motion.tscomponents/kino/input.tsxcomponents/kino/textarea.tsxlib/resize.tslib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/input-group.tsxcomponents/kino/password-input.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Props
Data attributes
Accessibility
- The toggle keeps one name, “Show password”, and says whether it is pressed, so a screen reader hears “Show password, pressed” once it shows.
- A press with the pointer leaves focus and the caret in the field; a key press leaves focus on the toggle.
- Spellcheck and autocapitalisation are off, so a shown password is never sent to a spellcheck service.
- The field stays a password field until it is shown, and turns back into one before its form is sent, so password managers and browsers treat it as a password.
- A disabled Field or Fieldset disables the toggle too.