Components › Feedback

Toast

Brief, non-blocking messages. Mount Toaster once and call toast() from anywhere.

Installation

npx plankui@latest add toast

Usage

import { Toast } from "@/components/ui/toast";

toast("Saved")
toast.success("Deployed", "acme-web is live.")
toast({ title: "Archived", action: { label: "Undo", onClick } })

API reference

PropTypeDefaultDescription
titlestringrequiredMain line.
descriptionstringSecond line.
tone"default" | "success" | "danger""default"Icon and colour.
action{ label: string; onClick: () => void }One inline action.
durationnumber4000Milliseconds before it leaves.

View the source on GitHub