Skip to content

Password field

Capture sensitive text with a visible reveal control.

FieldSecurity
npx shadcn@latest add @silicon-ui/password-field

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/password-field

Manually

  1. Install the dependencies

    npm install motion
  2. Copy these files into your project

    • components/silicon-ui/password-field/password-field.tsx
    • components/silicon-ui/password-field/password-field.module.css
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { PasswordField } from "@/components/silicon-ui/password-field/password-field";

API reference

PropTypeDefault
label*string—
descriptionstring—
messages

Translated or reworded toggle names.

Partial<PasswordFieldMessages>—

Also accepts the props of InputHTMLAttributes<HTMLInputElement>, except type.

Dependencies

npm
motion
Registry
silicon-motion-tokens