Brief, non-blocking notifications. Powered by Sonner.
$ pnpm dlx shadcn@latest add https://dashral.com/r/toast.jsonInstallation
$ pnpm dlx shadcn@latest add https://dashral.com/r/toast.jsonAdds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:
components.json
{
"registries": {
"@dashral": "https://dashral.com/r/{name}.json"
}
}Then add components by name:
$ pnpm dlx shadcn@latest add @dashral/toastUsage
example.tsx
import { Button } from "@/components/dashral/button"
import { Toaster, toast } from "@/components/dashral/toast"
<>
{/* Once, in your root layout */}
<Toaster />
<Button onClick={() => toast.success("Invoice sent", { description: "INV-1048 to Olivia Martin" })}>
Send invoice
</Button>
</>Examples
API reference
Toaster
Also takes every prop of Sonner(opens in a new tab).
| Prop | Type | Default |
|---|---|---|
theme | "light" | "dark" | "system"Follow your theme provider. | "system" |
position | string | "bottom-right" |
toast()
toast(message), toast.success / .error / .info / .warning / .loading / .promise.
Keyboard
| Keys | Action |
|---|---|
| Alt+T | Jump to the toasts |
| Tab | Reach a toast's action and close buttons |
Accessibility
- Announced through a polite live region; important errors should also be shown on the page.
Motion
- Slides in and stacks; swipe to dismiss on touch.