Xzero UI
Pro library

Password field

Capture sensitive text with a visible reveal control.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/password-field
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/password-field

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { PasswordField } from "@/components/xzero/password-field/password-field";

export function SignInPassword() {
  return (
    <PasswordField
      label="Password"
      name="password"
      autoComplete="current-password"
      required
    />
  );
}

Examples

Translated

<PasswordField label="Passwort" messages={{ showPassword: "Passwort anzeigen", hidePassword: "Passwort verbergen" }} />

API reference

PasswordField

A password input with a show and hide toggle whose eye icon is slashed by a drawn line.

PropTypeDefaultDescription
label (required)string–Visible label tied to the input.
descriptionstring–Helper copy under the field, linked through aria-describedby.
messagesPartial<{ showPassword: string; hidePassword: string }>{ showPassword: "Show password", hidePassword: "Hide password" }Names of the reveal toggle, for translation. Pass only the strings you change.
...propsOmit<InputHTMLAttributes<HTMLInputElement>, "type">–Forwarded to the input, including ref, value, onChange, name, and autoComplete.

Keyboard interactions

KeysAction
Enter / SpaceOn the toggle button, shows or hides the password.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in text fields

Guidance for AI tools

Password field: Capture sensitive text with a visible reveal control. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components