# Custom invert warning toast with countdown

> Custom invert warning toast with countdown

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-sonner-16).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-sonner-16
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-sonner-16-light-ba0545dd45272f72.png
- Registry item: https://reui.io/r/new-york-v4/c-sonner-16.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-sonner-16.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: `sonner`
- Registry items: `button`

## Files

### `c-sonner-16.tsx`

```tsx
import { toast } from "sonner"

import { Button } from "@/components/ui/button"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"

export function Pattern() {
  const showToast = () => {
    toast.custom(
      () => (
        <div className="bg-invert text-invert-foreground rounded-md flex w-[356px] items-start gap-3 border border-transparent p-4 shadow-lg">
          <div className="flex size-6 shrink-0 items-center justify-center rounded-full bg-amber-500 text-white">
            <IconPlaceholder
              lucide="AlertTriangleIcon"
              tabler="IconAlertTriangle"
              hugeicons="Alert02Icon"
              phosphor="WarningIcon"
              remixicon="RiAlertLine"
              className="size-3.5"
            />
          </div>
          <div className="flex flex-1 flex-col gap-1">
            <p className="text-sm font-semibold">Session Expiring</p>
            <p className="text-invert-foreground/70 text-sm">
              Your session will expire in 5 minutes due to inactivity.
            </p>
            <div className="mt-2">
              <Button
                size="xs"
                className="border-amber-700 bg-amber-500 text-white hover:border-amber-800 hover:bg-amber-600"
                onClick={() => {
                  toast.dismiss()
                  toast.success("Session extended")
                }}
              >
                Extend Session
              </Button>
            </div>
          </div>
        </div>
      ),
      { duration: 10000 }
    )
  }

  return (
    <div className="flex items-center justify-center">
      <Button onClick={showToast} variant="outline" className="w-fit">
        Invert Warning Toast
      </Button>
    </div>
  )
}
```
