Componentform0.82 KB gzipZero dependencies
Password Input
Password input with animated show/hide eye toggle.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add password-inputOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { PasswordInput } from "@/components/ui/password-input"; <PasswordInput />Source code
password-input.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxpassword-input.tsx70 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface PasswordInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> { onVisibilityChange?: (visible: boolean) => void;} /** Password input with visibility reveal toggle. */export const PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>( function PasswordInput({ onVisibilityChange, className, ...props }, ref) { const [visible, setVisible] = React.useState(false); return ( <div className={cn("relative", className)}> <input ref={ref}Props
| Prop | Type | Description |
|---|---|---|
| onVisibilityChange | (visible: boolean) => void | Callback invoked on visibility change. |