PasswordInput

Frond
Secrets: an Input with a show and hide toggle once there's a value. Same rules as Input.

Usage

The import, then a use to start from. Both copy as they are.

Import
import { Label } from "@/components/ui/label";import { PasswordInput } from "@/components/ui/password-input";
Example
<div className="flex flex-col gap-2">    <Label htmlFor="api-key">API key</Label>    <PasswordInput id="api-key" value={apiKey} onChange={(event) => setApiKey(event.target.value)} /></div>

When to use

Use it for

  • Any secret a person types or pastes: API keys, tokens, passwords. The toggle appears once there's a value.
  • Everything else follows Input: a visible Label, aria-invalid for errors, help text tied by aria-describedby.
  • containerClassName sizes the wrapper (flex-1, widths); className styles the input itself.

Avoid

  • An Input with type="password" and a hand-built toggle.
  • A secret only shown once, like a newly created token: show it in a CopyableText and say it won't be shown again.

Accessibility

Checks

  • The toggle is a labeled button (Show password, Hide password), so its state is announced.
  • Revealing only changes the field's type; focus and the value stay where they are.

API

Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.

PasswordInput

Its stories don't declare argTypes, so no props are listed. The variants show its states.
VariantsDefaultWithValueRevealedReadOnlyDisabled

Keep going

Patterns
How components come together into pages.