Copy to clipboard
Installation
Copy to clipboard
npx bearnie add toast
npx bearnie add toast
bunx bearnie add toast
bunx bearnie add toast
pnpm dlx bearnie add toast
pnpm dlx bearnie add toast
yarn dlx bearnie add toast
yarn dlx bearnie add toast
Copy to clipboard
import Toaster from "@/components/ui/toast/Toaster.astro";
Usage
import { Toaster } from "@/components/ui/toast"
toast("Event has been created.")
Examples
With title and description
Copy to clipboard
Success
Copy to clipboard
Error
Copy to clipboard
Warning
Copy to clipboard
Info
Copy to clipboard
With action
Copy to clipboard
Anatomy
Toaster- The container that renders toasts (add once to layout)
Props
Toaster
| Prop | Type | Default | Description |
|---|---|---|---|
| position | top-left | top-center | top-right | bottom-left | bottom-center | bottom-right | bottom-right | Toast position |
| class | string | - | Additional CSS classes |
toast() function
| Option | Type | Default | Description |
|---|---|---|---|
| title | string | - | Toast heading |
| description | string | - | Toast message |
| type | default | success | error | warning | info | default | Toast variant |
| duration | number | 4000 | Auto-dismiss time (ms) |
| action | object | - | Action button config |