# New Password 1

A shadcn/ui block from the [@diarmuradi](https://diarmuradi.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/diarmuradi/new-password-1).

- Page, with a live preview: https://shadcn.exchange/r/diarmuradi/new-password-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/diarmuradi/new-password-1-light-7ea550bbadfd17f0.png
- Registry item: https://diarmuradi.com/r/new-password-1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://diarmuradi.com/r/new-password-1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `lucide-react`
- Registry items: `https://diarmuradi.com/r/styles/base-nova/avatar.json`, `https://diarmuradi.com/r/styles/base-nova/button.json`, `https://diarmuradi.com/r/styles/base-nova/fancy-button.json`, `https://diarmuradi.com/r/styles/base-nova/field.json`, `https://diarmuradi.com/r/styles/base-nova/icons.json`, `https://diarmuradi.com/r/styles/base-nova/input-group.json`

## Files

### `new-password.tsx`

```tsx
"use client"

import { useId, useState } from "react"
import Link from "next/link"

import {
  Avatar,
  AvatarFallback,
  AvatarImage,
} from "@/components/ui/avatar"
import { Button } from "@/components/ui/button"
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"
import {
  InputGroup,
  InputGroupAddon,
  InputGroupButton,
  InputGroupInput,
} from "@/components/ui/input-group"
import { FancyButton } from "@/components/ui/fancy-button"
import { Icons } from "@/components/ui/icons"
import { EyeIcon, EyeOffIcon } from 'lucide-react'

export function NewPassword() {
  const id = useId()
  const [showPassword, setShowPassword] = useState(false)
  const [showConfirmPassword, setShowConfirmPassword] = useState(false)

  return (
    <main
      aria-label="New password"
      className="w-full max-w-xl rounded-4xl text-foreground motion-reduce:**:animate-none motion-reduce:**:transition-none lg:max-w-4xl lg:bg-muted lg:p-1"
    >
      <section className="grid grid-cols-1 lg:grid-cols-2">
        <div className="flex flex-col gap-6 rounded-3xl bg-card p-6 shadow-elevated-lg">
          <div className="flex flex-col items-center gap-4">
            <FancyButton
              size="icon-lg"
              aria-label="Home"
              role="link"
              className="size-14 rounded-xl"
              render={<Link href="/" />}
            >
              <Icons.Logo aria-hidden="true" className="size-10" />
            </FancyButton>
            <div className="text-center">
              <h1 className="text-xl font-semibold tracking-tight text-balance">
                Set new password
              </h1>
              <p className="text-base text-muted-foreground">
                Create a strong password for your account.
              </p>
            </div>
          </div>

          <FieldGroup className="gap-3">
            <Field className="gap-1">
              <FieldLabel htmlFor={`${id}-password`} className="gap-0">
                New password <span className="text-primary">*</span>
              </FieldLabel>
              <InputGroup className="h-10 bg-transparent">
                <InputGroupInput
                  id={`${id}-password`}
                  type={showPassword ? "text" : "password"}
                  placeholder="••••••••••"
                  className="h-10 bg-transparent"
                />
                <InputGroupAddon align="inline-end">
                  <InputGroupButton
                    size="icon-xs"
                    type="button"
                    onClick={() => setShowPassword((show) => !show)}
                    aria-label={
                      showPassword ? "Hide password" : "Show password"
                    }
                  >
                    {showPassword ? <EyeOffIcon  aria-hidden="true" /> : <EyeIcon  aria-hidden="true" />}
                  </InputGroupButton>
                </InputGroupAddon>
              </InputGroup>
            </Field>

            <Field className="gap-1">
              <FieldLabel htmlFor={`${id}-confirm-password`} className="gap-0">
                Confirm password <span className="text-primary">*</span>
              </FieldLabel>
              <InputGroup className="h-10 bg-transparent">
                <InputGroupInput
                  id={`${id}-confirm-password`}
                  type={showConfirmPassword ? "text" : "password"}
                  placeholder="••••••••••"
                  className="h-10 bg-transparent"
                />
                <InputGroupAddon align="inline-end">
                  <InputGroupButton
                    size="icon-xs"
                    type="button"
                    onClick={() => setShowConfirmPassword((show) => !show)}
                    aria-label={
                      showConfirmPassword
                        ? "Hide confirmation password"
                        : "Show confirmation password"
                    }
                  >
                    {showConfirmPassword ? <EyeOffIcon  aria-hidden="true" /> : <EyeIcon  aria-hidden="true" />}
                  </InputGroupButton>
                </InputGroupAddon>
              </InputGroup>
            </Field>

            <FancyButton type="button" size="lg" className="w-full">
              Update password
            </FancyButton>
          </FieldGroup>

          <p className="text-center text-sm text-muted-foreground">
            Remember your password?{" "}
            <Button
              variant="link"
              className="h-auto p-0"
              nativeButton={false}
              role="link"
              render={<Link href="/sign-in" />}
            >
              Back to login
            </Button>
          </p>
        </div>

        <div className="flex max-lg:hidden lg:flex-col lg:justify-end lg:p-12">
          <div className="mt-auto flex flex-col gap-6">
            <p className="text-lg leading-relaxed">
              &ldquo;Updating my password was{" "}
              <span className="font-medium text-primary">effortless</span>.
              Clear instructions, no confusion — done in seconds.&rdquo;
            </p>
            <div className="flex items-center gap-3">
              <Avatar className="size-10">
                <AvatarImage
                  src="https://github.com/timneutkens.png"
                  alt="Tim Neutkens"
                />
                <AvatarFallback>T</AvatarFallback>
              </Avatar>
              <div>
                <p className="text-sm font-semibold">Tim Neutkens</p>
                <p className="text-xs text-muted-foreground">Next.js</p>
              </div>
            </div>
          </div>
        </div>
      </section>
    </main>
  )
}
```
