Skip to main content
BlocksReset passwordCentred card with live checklist and strength meter

shadcn/ui Reset password block for Base UICentred card with live checklist and strength meter

Reset-password Card for shadcn/ui with new and confirm password Inputs, each with an Eye/EyeOff icon Button to show or hide the value. A four-segment strength meter colours from bg-destructive through bg-chart-4 to bg-chart-2 as the password improves, and a requirement checklist (8+ characters, number, symbol, match) flips Circle icons to Check icons via useState. Ends in a full-width "Reset password" submit.

Free@shadcnpro/base/reset-password-01

Preview

Installation

npx shadcn@latest add @shadcnpro/base/reset-password-01

First time? Add the @shadcnpro registry to components.json as shown in Installation. Free blocks install without a license key.

Let your AI editor install it

The shadcn/ui Pro MCP server lets Cursor, Claude Code and VS Code find and install blocks like Centred card with live checklist and strength meter from one prompt. It is included in every Pro plan.

Add the shadcn/ui components

Centred card with live checklist and strength meter uses Button, Card, Input and Label, from the Base UI components set up in your components.json.

npx shadcn@latest add button card input label

Install the npm packages

npm install lucide-react

Copy the code

Paste it into components/blocks/reset-password-01.tsx.

components/blocks/reset-password-01.tsx
'use client';

import { CheckIcon, CircleIcon, EyeIcon, EyeOffIcon } from 'lucide-react';
import { useState } from 'react';

import { Button } from '@/components/ui/button';
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { cn } from '@/lib/utils';

/**
 * Centred reset-password Card with new/confirm fields and show-hide toggles, a live requirement checklist driven by state and a four-segment strength meter coloured from destructive through chart-4 to chart-2.
 */
export default function ResetPassword01() {
  const [password, setPassword] = useState('');
  const [confirm, setConfirm] = useState('');
  const [showPassword, setShowPassword] = useState(false);
  const [showConfirm, setShowConfirm] = useState(false);

  const rules = [
    { label: 'At least 8 characters', met: password.length >= 8 },
    { label: 'Contains a number', met: /\d/.test(password) },
    { label: 'Contains a symbol', met: /[^A-Za-z0-9]/.test(password) },
    { label: 'Both passwords match', met: password.length > 0 && password === confirm },
  ];

  const score =
    Number(password.length >= 8) +
    Number(/\d/.test(password)) +
    Number(/[^A-Za-z0-9]/.test(password)) +
    Number(password.length >= 12 && /[A-Z]/.test(password));

  const strength =
    password.length === 0
      ? { label: 'Start typing', color: 'bg-border' }
      : score <= 1
        ? { label: 'Weak', color: 'bg-destructive' }
        : score <= 3
          ? { label: 'Fair', color: 'bg-chart-4' }
          : { label: 'Strong', color: 'bg-chart-2' };

  return (
    <div className="w-full max-w-sm px-4 py-8">
      <Card className="w-full">
        <CardHeader>
          <a className="mb-2 flex items-center gap-2" href="#">
            <img alt="" className="size-8 rounded-lg object-cover" src="/logo.png" />
            <span className="font-semibold text-foreground text-lg">Beacon</span>
          </a>
          <CardTitle className="font-semibold text-2xl tracking-tight">
            Choose a new password
          </CardTitle>
          <CardDescription className="text-pretty">
            You&apos;re resetting the password for{' '}
            <span className="font-medium text-foreground">maja@auroralabs.io</span>.
          </CardDescription>
        </CardHeader>
        <form onSubmit={(e) => e.preventDefault()}>
          <CardContent className="space-y-5">
            <div className="space-y-1.5">
              <Label htmlFor="reset01-password">New password</Label>
              <div className="relative">
                <Input
                  autoComplete="new-password"
                  className="pr-10"
                  id="reset01-password"
                  name="password"
                  onChange={(e) => setPassword(e.target.value)}
                  type={showPassword ? 'text' : 'password'}
                  value={password}
                />
                <Button
                  aria-label={showPassword ? 'Hide password' : 'Show password'}
                  aria-pressed={showPassword}
                  className="absolute top-1/2 right-1 size-7 -translate-y-1/2 text-muted-foreground"
                  onClick={() => setShowPassword((v) => !v)}
                  size="icon"
                  type="button"
                  variant="ghost"
                >
                  {showPassword ? (
                    <EyeOffIcon aria-hidden="true" className="size-4" />
                  ) : (
                    <EyeIcon aria-hidden="true" className="size-4" />
                  )}
                </Button>
              </div>
            </div>

            <div className="space-y-1.5">
              <Label htmlFor="reset01-confirm">Confirm password</Label>
              <div className="relative">
                <Input
                  autoComplete="new-password"
                  className="pr-10"
                  id="reset01-confirm"
                  name="confirmPassword"
                  onChange={(e) => setConfirm(e.target.value)}
                  type={showConfirm ? 'text' : 'password'}
                  value={confirm}
                />
                <Button
                  aria-label={showConfirm ? 'Hide password' : 'Show password'}
                  aria-pressed={showConfirm}
                  className="absolute top-1/2 right-1 size-7 -translate-y-1/2 text-muted-foreground"
                  onClick={() => setShowConfirm((v) => !v)}
                  size="icon"
                  type="button"
                  variant="ghost"
                >
                  {showConfirm ? (
                    <EyeOffIcon aria-hidden="true" className="size-4" />
                  ) : (
                    <EyeIcon aria-hidden="true" className="size-4" />
                  )}
                </Button>
              </div>
            </div>

            <div className="space-y-2">
              <div className="flex items-center justify-between text-xs">
                <span className="text-muted-foreground">Password strength</span>
                <span
                  aria-live="polite"
                  className={cn(
                    'font-medium',
                    password.length === 0 ? 'text-muted-foreground' : 'text-foreground'
                  )}
                >
                  {strength.label}
                </span>
              </div>
              <div aria-hidden="true" className="grid grid-cols-4 gap-1.5">
                {[0, 1, 2, 3].map((segment) => (
                  <span
                    className={cn(
                      'h-1.5 rounded-full transition-colors',
                      segment < score ? strength.color : 'bg-border'
                    )}
                    key={segment}
                  />
                ))}
              </div>
            </div>

            <ul className="space-y-2">
              {rules.map((rule) => (
                <li
                  className={cn(
                    'flex items-center gap-2 text-sm transition-colors',
                    rule.met ? 'text-foreground' : 'text-muted-foreground'
                  )}
                  key={rule.label}
                >
                  {rule.met ? (
                    <CheckIcon aria-hidden="true" className="size-4 text-chart-2" />
                  ) : (
                    <CircleIcon aria-hidden="true" className="size-4 text-border" />
                  )}
                  <span>{rule.label}</span>
                  <span className="sr-only">{rule.met ? ' – met' : ' – not met'}</span>
                </li>
              ))}
            </ul>

            <Button className="w-full" type="submit">
              Reset password
            </Button>
          </CardContent>
        </form>
        <CardFooter className="justify-center">
          <a className="text-muted-foreground text-sm hover:text-foreground" href="#">
            Back to sign in
          </a>
        </CardFooter>
      </Card>
    </div>
  );
}

Use it

Import it where you need it and update the import path to match your project.

Usage
import ResetPassword01 from '@/components/blocks/reset-password-01';

export default function Page() {
  return <ResetPassword01 />;
}

Overview

Centred card with live checklist and strength meter is a free reset password block for shadcn/ui and Base UI. It is built from the Button, Card, Input and Label components with lucide-react, and installs as a single file you own and can edit.

It only uses semantic tokens such as bg-background, text-muted-foreground and border-border, so it follows your theme, radius and fonts and switches with dark mode. It is responsive from desktop to mobile; the width controls above the preview show each size. The same layout is in the shadcn/ui Pro Figma kit, so design and code start from one source.

Component library
Base UI (@base-ui/react)
Also available for
Radix UI, React Aria
Built with
Button, Card, Input and Label
npm packages
lucide-react
Files
components/blocks/reset-password-01.tsx
Access
Free, installs without a license key

Frequently asked questions

Pricing, installation and Base UI details for Centred card with live checklist and strength meter.