nextui.dev
Home
Library
Docs
Pricing
Components26
AI & agents5
  • AI chat inputPro
  • Agent task checklistPro
  • Agent thinking
  • Thinking indicator
  • Prompt deckNew
Forms & inputs7
  • Input with label
  • Input with icon and button
  • Settings switches
  • Password with strength meter
  • One-time code input
  • WaitlistNew
  • File dropzonePro
Cards5
  • Style marquee cardPro
  • Folder card
  • Celebration cardPro
  • Smart PDF stackNew
  • Waitlist pass
Buttons, badges & avatars5
  • Buttons with icons
  • QR scan badge
  • Avatar group
  • Rolling price badge
  • Avatars with status
Feedback & display4
  • Alert banners
  • FAQ accordion
  • Keyboard shortcuts
  • Empty state
Blocks11
Hero4
  • Animated pill heroPro
  • Integrations grid hero
  • Waitlist heroNew
  • Orbit chat heroNew
Features & pricing3
  • Usage cardPro
  • Three-tier pricing
  • Feature with board
Testimonials & team3
  • Testimonial cards
  • Single quote
  • Team carousel
Sign-in1
  • Sign-in cardPro
Motion2
Effects2
  • Text revealPro
  • Sound ringNew
Themes9
  • Default
  • Ember
  • Ocean
  • Forest
  • Grape
  • Rose
  • Amber
  • Clay
  • Brutal
nextui.dev

nextui components, blocks and themes you install with one command.

Product

  • Components
  • Blocks
  • Motion
  • Themes
  • Pricing

Resources

  • Docs
  • Roadmap
  • GitHub

Legal

  • License
  • Privacy
  • Terms
  • Refunds

nextUI

[ 200 OK ] · nextUI

© 2026 NEXTUI.DEV. All rights reserved.

ComponentsForms & inputsPassword with strength meter

Password with strength meter

Password input with show/hide toggle and a live strength checklist.

Copy prompt
MCP

Installation

Runs as is, no setup needed. Want a shorter command like @nextui/input-03? See short names.

$pnpm dlx shadcn@latest add https://tinistudio.vercel.app/r/input-03.json

Related

All components

Input with label

Email input with a label and helper text.

Input with icon and button

Newsletter-style input with a leading icon and submit button.

Settings switches

Notification settings list with switches.

npx shadcn@latest add https://tinistudio.vercel.app/r/input-03.json
components/nextui/input-03.tsx
"use client";

import { useState } from "react";
import { Eye, EyeOff } from "lucide-react";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { cn } from "@/lib/utils";

const RULES = [
  { label: "8+ characters", test: (v: string) => v.length >= 8 },
  { label: "A number", test: (v: string) => /\d/.test(v) },
  { label: "An uppercase letter", test: (v: string) => /[A-Z]/.test(v) },
  { label: "A symbol", test: (v: string) => /[^A-Za-z0-9]/.test(v) },
];

export default function Input03() {
  const [value, setValue] = useState("");
  const [show, setShow] = useState(false);
  const score = RULES.filter((r) => r.test(value)).length;
  const tone = ["bg-border", "bg-destructive", "bg-orange-500", "bg-amber-500", "bg-emerald-500"][score];

  return (
    <div className="w-full max-w-xs space-y-2">
      <Label htmlFor="password-03">Password</Label>
      <div className="relative">
        <Input
          id="password-03"
          type={show ? "text" : "password"}
          value={value}
          onChange={(e) => setValue(e.target.value)}
          placeholder="Create a password"
          className="pr-10"
        />
        <button
          type="button"
          onClick={() => setShow((s) => !s)}
          aria-label={show ? "Hide password" : "Show password"}
          className="absolute inset-y-0 right-0 grid w-10 place-items-center text-muted-foreground hover:text-foreground"
        >
          {show ? <EyeOff className="size-4" /> : <Eye className="size-4" />}
        </button>
      </div>
      <div className="flex gap-1" aria-hidden>
        {RULES.map((_, i) => (
          <span key={i} className={cn("h-1 flex-1 rounded-full transition-colors", i < score ? tone : "bg-border")} />
        ))}
      </div>
      <ul className="space-y-1 text-xs">
        {RULES.map((rule) => (
          <li key={rule.label} className={rule.test(value) ? "text-foreground" : "text-muted-foreground"}>
            {rule.test(value) ? "✓" : "·"} {rule.label}
          </li>
        ))}
      </ul>
    </div>
  );
}
Sign in