# V toast 8

> Staggered Notification Burst

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

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

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-toast-8.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/toast`

## Files

### `registry/default/variants/v-toast-8.tsx`

```tsx
"use client";

import { useState } from "react";
import { Button } from "@/registry/default/ui/button";
import { toastManager } from "@/registry/default/ui/toast";

const notifications = [
  {
    delay: 0,
    description: "Alex Rivera started following you.",
    title: "New follower",
    type: "info" as const,
  },
  {
    delay: 800,
    description: 'Your post "Building with Base UI" got 142 likes.',
    title: "Post liked",
    type: "success" as const,
  },
  {
    delay: 1600,
    description: 'Sarah replied to your comment: "Great point!"',
    title: "New reply",
    type: "info" as const,
  },
  {
    delay: 2400,
    description: "You were mentioned in a thread by @devmark.",
    title: "Mentioned",
    type: "warning" as const,
  },
];

export function Pattern() {
  const [firing, setFiring] = useState(false);

  function fireAll() {
    if (firing) return;
    setFiring(true);
    notifications.forEach(({ delay, ...toast }) => {
      setTimeout(() => toastManager.add(toast), delay);
    });
    setTimeout(
      () => setFiring(false),
      (notifications.at(-1)?.delay ?? 0) + 500,
    );
  }

  return (
    <Button disabled={firing} onClick={fireAll} variant="outline">
      {firing ? "Incoming…" : "Simulate notifications"}
    </Button>
  );
}
```
