Componentform0.82 KB gzipZero dependencies

Password Input

Password input with animated show/hide eye toggle.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add password-input

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { PasswordInput } from "@/components/ui/password-input"; <PasswordInput />

Source code

password-input.tsx + 1 helper

Zero 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

PropTypeDescription
onVisibilityChange(visible: boolean) => voidCallback invoked on visibility change.