Toast
Transient messages. Toasts pile up with the newest in front, and fan out on hover.
Playground
Every kind of toast. Each setting answers with a toast.
Usage
Import the parts you need from the component's folder.
ts
import { Toaster, toast } from "@/components/ui/toast";Default
Call toast from a click.
Types
Errors close after 8 seconds, the rest after 5. Loading toasts and toasts with a button stay.
With description
A second line under the title.
Promise
A loading toast that morphs into the result.
Update in place
Every call returns an id. Pass it to toast.update.
Actions
Return a patch from onClick to morph the toast, or nothing to close it.
Light and dark
Inverted against the page: dark on light, light on dark. Pass theme to pin one.
Switching the engine
The engine is our own copy of Ding. index.ts holds the two lines that put vue-sonner back.