# V alert 15

> Email verification with resend countdown

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-alert-15).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-alert-15
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-alert-15-light-2cb27eabfc0bbbbf.png
- Registry item: https://ui.cnippet.dev/r/v-alert-15.json
- Categories: alert
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-alert-15.json
```

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

## Dependencies

- Registry items: `@cnippet/alert`

## Files

### `registry/default/variants/v-alert-15.tsx`

```tsx
"use client";

import { MailIcon } from "lucide-react";
import { useEffect, useState } from "react";
import {
  Alert,
  AlertAction,
  AlertDescription,
  AlertTitle,
} from "@/registry/default/ui/alert";
import { Button } from "@/registry/default/ui/button";

export function Pattern() {
  const [sent, setSent] = useState(false);
  const [countdown, setCountdown] = useState(0);

  useEffect(() => {
    if (countdown <= 0) return;
    const t = setTimeout(() => setCountdown((c) => c - 1), 1000);
    return () => clearTimeout(t);
  }, [countdown]);

  const handleResend = () => {
    setSent(true);
    setCountdown(60);
  };

  return (
    <div className="w-full max-w-lg">
      <Alert>
        <MailIcon />
        <AlertTitle>Verify your email address</AlertTitle>
        <AlertAction>
          <Button
            disabled={countdown > 0}
            onClick={handleResend}
            size="xs"
            variant="outline"
          >
            {countdown > 0 ? `Resend in ${countdown}s` : "Resend"}
          </Button>
        </AlertAction>
        <AlertDescription>
          {sent
            ? "A new verification email has been sent to your inbox."
            : "We sent a confirmation link to hello@example.com. Check your inbox and click the link to activate your account."}
        </AlertDescription>
      </Alert>
    </div>
  );
}
```
