Toasts
Usage and anatomy
Render one Toaster near the root of the application, then call the matching toast method from an event or application workflow. Each method receives a title followed by a supporting message.
import { Toaster, toast } from "@acme/ui/toast"export function App() {return (<><button onClick={() => toast.success("Changes saved", "Your settings are up to date.")}>Save changes</button><Toaster /></>)}
Choose the toast type that matches the outcome so the icon and color communicate the same status as the copy.
Toasts - Success
License required
In order to get the source code for this component, you need to buy a license.
Toasts - Warning
License required
In order to get the source code for this component, you need to buy a license.
Toasts - Error
License required
In order to get the source code for this component, you need to buy a license.
Toasts - Information
License required
In order to get the source code for this component, you need to buy a license.
API reference
toast
| Method | Arguments | Status |
|---|---|---|
| toast.success | (title: string, message: string) | Successful outcome |
| toast.warning | (title: string, message: string) | Potential issue |
| toast.error | (title: string, message: string) | Failed outcome |
| toast.information | (title: string, message: string) | Neutral information |
Toaster
Toaster accepts Sonner's Toaster props. Notifications remain visible for 8000 milliseconds by default; pass duration to override that value.