Toast
Slaps onto the bottom of the screen like a stamp, then lifts off after a few seconds. The wash behind it takes its kind (red for an error, green for success), and it can celebrate or wince when it lands.
Client componentWCAG AASince v0.1
Live example
Sketch posted
Couldn’t send. Saved for later.
import { toast } from "@plop-ui/react";
toast.success("Sketch posted");
toast.error("Couldn't post. Saved for later.");
toast("Rosa liked your sketch", { duration: 6000 });
// A burst when it lands (off by default): true picks confetti for success,
// a poof of dust and a shake for error, a sparkle for info. Or name a style.
toast.success("All done!", { burst: true, buddy: "congrats" });
toast.error("Couldn't post", { burst: "zap" });
// Behind a live toast: a solid gradient wash (default), comic dots, or nothing.
<PlopProvider toastBackdrop="solid" /> // "dots" | "none"Change every prop live in the playground.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| childrenrequired | ReactNode | none | The message, lettered in Sketchpop. |
| buddy | boolean | BuddyMood | none | A character peeks over the toast: true picks one for the kind, or name a mood. |
| className | string | none | Extra class on the toast. |
| kind | "success" | "error" | "info" | info | Sets the color and icon: info, success or error. |
Use it well
DoConfirm something that already happened: "Sketch posted".
Don'tAsk a question or hide a button in a toast. It disappears.
Accessibility
- Shown in a polite live region (role="status") rendered by PlopProvider.
- Stays 4 seconds by default; never the only place an important message appears.