Command Palette

Search for a command to run...

Password Input

A password field with a trailing show/hide toggle, composed from the input-group primitive. Spreads native input props (name, value, onChange, placeholder).

A password field with a trailing button that toggles between masked and plain text. It is built from the input-group primitive, so the toggle sits inside the same bordered control as the input. Every native <input> prop is forwarded — name, value / defaultValue, onChange, placeholder, disabled — so it drops into a form like a plain input.

Installation

One-time setup: add the @ikui registry to your components.json.

components.json
{
  "registries": {
    "@ikui": "https://ik-ui.pages.dev/r/{name}.json"
  }
}

Then install the component:

pnpm dlx shadcn@latest add @ikui/password-input

Usage

import { PasswordInput } from "@/components/password-input";
<PasswordInput name="password" placeholder="Password" />

Examples

Controlled

value + onChange work exactly as on a native input. The toggle only switches the rendered type; it never changes the value.

Disabled

disabled dims the field and also disables the show/hide toggle.

Props

PasswordInput accepts every prop of a native <input> element (React.ComponentProps<"input">) and forwards them to the underlying control.

PropTypeDefault
value / defaultValue
string
-
onChange
(e: React.ChangeEvent<HTMLInputElement>) => void
-
disabled
boolean
false
className
string
-
...props
React.ComponentProps<"input">
-