Skip to contentKino
Skip to Content

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.json
Share on

Examples

KinoSign in to your workspace

Kino uses email and password.

It’s quiet-harbour-41 in this demo. Show it, then sign in: it hides as the form is sent.

Default

Show the password, then sign in: it hides again as the form is sent, so the browser never saves it as text.

Password strength
x
  • 15 characters or more

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.

Either eye shows both, so you can compare them.

Controlled

Own visible to show two fields together.

Installation

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

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Props

PropTypeDefaultDescription
visiblebooleanNoneWhether the password shows as text.
defaultVisiblebooleanfalseWhether it shows at first, when you don’t own visible.
onVisibleChange(visible: boolean) => voidNoneCalled when the toggle is pressed, and with false when the form is sent or reset, or the page comes back from the browser’s history.
toggleLabelstring'Show password'The toggle’s name. Give each password field on a page its own, such as “Show new password”.
autoComplete'current-password''new-password''off''current-password'What a password manager fills in or offers.

Data attributes

AttributeOnDescription
data-visiblePasswordInputPresent while the password shows as text.

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.