Appearance
Toaster
Host sonner — mount một lần gần root app.
ts
import { Toaster, toast } from "@minap/ui";Examples
Mẫu sống trong Preview; chọn View code khi cần copy.
Usage
tsx
import { Button, Toaster, toast } from "@minap/ui";
export function Example() {
return (
<>
<Toaster />
<div className="flex flex-wrap gap-2">
<Button onClick={() => toast("Saved", { description: "default" })}>Default</Button>
<Button variant="secondary" onClick={() => toast.success("Done", { description: "success" })}>
Success
</Button>
<Button variant="secondary" onClick={() => toast.warning("Check", { description: "warning" })}>
Warning
</Button>
<Button color="destructive" onClick={() => toast.error("Failed", { description: "destructive" })}>
Error
</Button>
<Button variant="outline" onClick={() => toast.info("Note", { description: "info" })}>
Info
</Button>
</div>
</>
);
}Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
position | sonner Position | — | Truyền thẳng |
theme | sonner | — |
Behavior
- SoT toast duy nhất (không song song lib toast khác)