ZUI

Search documentation

Find a page or a heading.

Password Input

A password field over upstream InputGroup whose composed toggle shows or hides the password.

tsx

Installation

bash

Usage

tsx
tsx

The consumer composes the toggle inside an InputGroupAddon, beside any other addon such as a leading lock icon, and names it with a fixed aria-label such as Show password. Use it for any password field that needs a visibility toggle.

Composition

text

API reference

PasswordInput

Renders shadcn's InputGroup and takes every prop it takes. The root holds whether the password shows and carries data-visible while it does; className places the group. It sets data-slot="password-input", and its focus ring reads PasswordInputInput's own slot in place of upstream's input-group-control.

PasswordInputInput

Renders shadcn's InputGroupInput and takes every prop it takes except type. Typed password or text as the root says. It sets data-slot="password-input-input" in place of upstream's input-group-control, which the root's focus ring reads (the invalid ring reads any data-slot, so it still applies unchanged).

PasswordInputToggle

Renders shadcn's InputGroupButton and takes every prop it takes except children. The show/hide toggle, a ghost icon-xs button, pressed (aria-pressed) while the password shows; the caller names it with a fixed aria-label. It stays out of the tab order, so Tab moves from the password to the next field, and its eye plays on hover or focus. It sets data-slot="password-input-toggle".