Password Input

A password field with a show and hide toggle inside the input, an eye icon that swaps state and an accessible label. Supports sm, default and lg sizes in React.

src/registry/ui/password-input.tsx/r/password-input.json

Installation#

bash
npx shadcn@latest add @minidev/password-input

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/password-input.json

Usage#

tsx
import { PasswordInput } from "@/components/ui/password-input"

export function Example() {
  return (
    <PasswordInput id="pw" aria-label="Password" />
  )
}

API reference#

PasswordInput props
PropTypeDefault
size"sm" | "default" | "lg""default"

Also accepts every prop of <input>, passed through to the root element.

Dependencies#

npm

lucide-react

Examples#

All form components