# Custom invert error toast with details

> Custom invert error toast with details

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

- Page, with a live preview: https://shadcn.exchange/r/reui/c-sonner-14
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-sonner-14-light-1335a0dcf5a1c895.png
- Registry item: https://reui.io/r/new-york-v4/c-sonner-14.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-14.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`, `separator`

## Files

### `c-sonner-14.tsx`

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

import { Button } from "@/components/ui/button"
import { Separator } from "@/components/ui/separator"
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] flex-col gap-3 border border-transparent p-4 shadow-lg">
        <div className="flex items-start gap-3">
          <div className="flex size-6 shrink-0 items-center justify-center rounded-full bg-red-500 text-white">
            <IconPlaceholder
              lucide="XIcon"
              tabler="IconX"
              hugeicons="MultiplicationSignIcon"
              phosphor="XIcon"
              remixicon="RiCloseLine"
              className="size-3.5"
            />
          </div>
          <div className="flex flex-1 flex-col gap-1">
            <p className="text-sm font-semibold">Build Failed</p>
            <p className="text-invert-foreground/70 text-sm">
              Compilation error in 2 files. Fix errors before deploying.
            </p>
          </div>
        </div>
        <Separator className="bg-border/10" />
        <div className="text-invert-foreground/60 space-y-1 font-mono text-xs">
          <p>src/api/auth.ts:42 — TypeError: undefined is not a function</p>
          <p>src/utils/parse.ts:18 — SyntaxError: Unexpected token</p>
        </div>
        <div className="flex gap-2">
          <Button
            size="xs"
            variant="outline"
            className="bg-background/10 border-border/10 text-invert-foreground flex-1"
            onClick={() => toast.dismiss()}
          >
            View Logs
          </Button>
          <Button
            size="xs"
            className="flex-1 border-red-800 bg-red-500 text-white hover:border-red-900 hover:bg-red-600"
            onClick={() => toast.dismiss()}
          >
            Retry Build
          </Button>
        </div>
      </div>
    ))
  }

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