{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toast",
  "title": "Toast",
  "author": "Ballmac <https://ui.ballmac.com>",
  "description": "Stacked toasts on Sonner styled with theme tokens: status icons, actions, promises, swipe to dismiss, pause on hover and focus, and screen-reader announcements.",
  "dependencies": [
    "sonner@^2",
    "lucide-react"
  ],
  "files": [
    {
      "path": "registry/ballmac/components/toast.tsx",
      "content": "// Ballmac UI: Toast. https://ui.ballmac.com/components/toast\n// Based on shadcn/ui Sonner (MIT, Copyright (c) 2023 shadcn) on Sonner (MIT, Copyright (c) 2023 Emil Kowalski), restyled with theme tokens (so it follows the site's light and dark mode without a theme provider), status icons, and accessible action buttons.\n\"use client\";\n\nimport * as React from \"react\";\nimport { CircleAlert, CircleCheck, Info, Loader, TriangleAlert, X } from \"lucide-react\";\nimport { Toaster as Sonner, toast } from \"sonner\";\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>;\n\n/**\n * Mount once near the root of your app. Call `toast(\"Saved\")`, `toast.success(...)`, `toast.error(...)`,\n * `toast.promise(...)` or `toast.custom(...)` from anywhere. Toasts are announced to screen readers,\n * pause while hovered or focused, and can be dismissed with Escape after pressing Alt+T to focus the region.\n */\nfunction Toaster({ toastOptions, icons, ...props }: ToasterProps) {\n  return (\n    <Sonner\n      className=\"toaster group\"\n      closeButton\n      icons={{\n        success: <CircleCheck aria-hidden=\"true\" className=\"size-4 text-chart-2\" />,\n        info: <Info aria-hidden=\"true\" className=\"size-4 text-primary\" />,\n        warning: <TriangleAlert aria-hidden=\"true\" className=\"size-4 text-chart-3\" />,\n        error: <CircleAlert aria-hidden=\"true\" className=\"size-4 text-destructive\" />,\n        loading: <Loader aria-hidden=\"true\" className=\"size-4 animate-spin motion-reduce:animate-none\" />,\n        close: <X aria-hidden=\"true\" className=\"size-3.5\" />,\n        ...icons,\n      }}\n      style={\n        {\n          \"--normal-bg\": \"var(--popover)\",\n          \"--normal-text\": \"var(--popover-foreground)\",\n          \"--normal-border\": \"var(--border)\",\n          \"--border-radius\": \"var(--radius-xl, 0.75rem)\",\n        } as React.CSSProperties\n      }\n      toastOptions={{\n        ...toastOptions,\n        classNames: {\n          toast: \"!shadow-[0_12px_36px_-10px_rgb(0_0_0/0.25)] !gap-3 !p-4 !font-sans\",\n          title: \"!text-sm !font-medium\",\n          description: \"!text-sm !text-muted-foreground\",\n          actionButton: \"!bg-primary !text-primary-foreground !rounded-md !h-8 !px-3 !text-[13px] !font-medium focus-visible:!ring-[3px] focus-visible:!ring-ring/50\",\n          cancelButton: \"!bg-muted !text-foreground !rounded-md !h-8 !px-3 !text-[13px] !font-medium focus-visible:!ring-[3px] focus-visible:!ring-ring/50\",\n          closeButton: \"!bg-popover !border-border !text-muted-foreground hover:!text-foreground\",\n          ...toastOptions?.classNames,\n        },\n      }}\n      {...props}\n    />\n  );\n}\n\nexport { Toaster, toast, type ToasterProps };\n",
      "type": "registry:ui",
      "target": "@components/ballmac/toast.tsx"
    }
  ],
  "meta": {
    "schema": 1,
    "tier": "free",
    "tags": [
      "toast",
      "notification",
      "sonner",
      "feedback"
    ],
    "version": "1.0.0",
    "updated": "2026-09-30",
    "ai": {
      "summary": "Render <Toaster /> once, then call toast(), toast.success(), toast.error() or toast.promise() from anywhere.",
      "whenToUse": [
        "Confirming an action (saved, copied, archived)",
        "Undo prompts",
        "Background task results"
      ],
      "whenNotToUse": [
        "Errors the user must fix in a form; use field errors",
        "Permanent page messages; use alert or banner",
        "A macOS-style stack; use toast-stack"
      ],
      "composesWith": [
        "button",
        "toast-stack"
      ],
      "a11y": [
        {
          "keys": "Alt+T",
          "action": "Focuses the notification region"
        },
        {
          "keys": "Tab",
          "action": "Reaches toast actions and close buttons"
        },
        {
          "keys": "Screen readers",
          "action": "Toasts are announced politely"
        }
      ],
      "customization": [
        "position",
        "duration",
        "action and cancel buttons",
        "toasterId for multiple regions"
      ]
    },
    "source": {
      "name": "shadcn/ui Sonner",
      "url": "https://github.com/shadcn-ui/ui",
      "license": "MIT",
      "copyright": "Copyright (c) 2023 shadcn",
      "modified": true
    },
    "examples": [
      "toast-demo",
      "toast-states"
    ],
    "url": "https://ui.ballmac.com/components/toast"
  },
  "categories": [
    "feedback"
  ],
  "type": "registry:ui"
}