Forms

Password Input

Input variant for password entry with an eye toggle to reveal characters.

Preview
01 Installation

Install

Pull Password Input from the barrel for everyday use, or the granular path when you want a tighter bundle.

tsxBarrel1 line
import { PasswordInput } from "@brika/clay";
tsxGranular1 line
import { PasswordInput } from "@brika/clay/components/password-input";
02 Usage

A minimal example

Drop this into a page. Native HTML attributes pass through to the underlying primitive.

tsxPassword Input.tsx10 lines
import { PasswordInput } from '@brika/clay/components/password-input';

/** Password field with lock icon and eye toggle to reveal characters. */
export default function PasswordInputDefaultDemo() {
  return (
    <div className="w-full max-w-xs">
      <PasswordInput placeholder="Enter your password" />
    </div>
  );
}
03 Examples

Password Input, every way

Disabled

Disabled password input, preserves layout, all interactions blocked.

Form

Full sign-in form context, password input paired with an email input and submit button.

Invalid

Invalid state surfaced via aria-invalid, shows destructive ring and border.

04 Accessibility

Accessibility

  • The reveal toggle carries aria-label that updates between "Show password" and "Hide password".
  • The underlying input switches between type="password" and type="text", AT announces the mode change.
  • aria-invalid="true" triggers the destructive ring; pair with a visible error message.
  • Autocomplete attributes like autocomplete="current-password" improve password-manager integration.
05 API reference

API reference

Props specific to Password Input. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.

  • hideLabeldefault 'Hide password'
    string
    aria-label for the hide-password toggle.
  • showLabeldefault 'Show password'
    string
    aria-label for the show-password toggle.