Ballmac UI home

Toast

Stacked toasts on Sonner styled with theme tokens: status icons, actions, promises, swipe to dismiss, pause on hover and focus, and screen-reader announcements.

Notifications

Each button shows a different toast.

Installation

$ pnpm dlx shadcn@latest add @ballmac/toast

Usage

import { Toaster, toast } from "@/components/ballmac/toast"

The full example is in the Code tab above.

Examples

Action and warning

Accessibility

KeyAction
Alt+TFocuses the notification region
TabReaches toast actions and close buttons
Screen readersToasts are announced politely

Use with AI

Render <Toaster /> once, then call toast(), toast.success(), toast.error() or toast.promise() from anywhere. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Toast (@ballmac/toast) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Confirming an action (saved, copied, archived)
  • Undo prompts
  • Background task results

Not for

  • 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

Registry JSON: https://ui.ballmac.com/r/toast.json

Credits

Based on shadcn/ui Sonner, adapted by Ballmac. Free to use in personal and commercial projects.

Registry
None