#1042 · Draft
Cat in a teacup, take two
Not posted yet. Give it a title before you publish.
Preview
A cast of characters, one per state: Pip cheers success, Bix winces at errors, Snooze dozes on stale data, Confetti celebrates, Specs previews and Hum thinks while loading. Stand one alone, or let it peek over any component.
mood="success"Cheers when something worked: saved, sent, copied.mood="error"Winces when something failed and needs another try.mood="stale"Dozes off when data is out of date or still waiting.mood="congrats"Throws a little party for milestones: zine finished, all shipped.mood="preview"Peeks at previews, drafts and things worth a look.mood="thinking"Mulls it over while something loads or works.import { Buddy, BuddyPeek, Callout, toast } from "@plop-ui/react";
<Buddy mood="congrats" size="lg" />
// Peek over anything: the head ducks behind it, the hands grip the edge.
<BuddyPeek mood="preview">
<TicketCard title="Cat in a teacup" meta="#1042 · Draft" />
</BuddyPeek>
// Built into Toast and Callout: true picks the character for the kind or tone.
toast.success("Copied to clipboard", { buddy: true }); // Pip
toast("Every page is filled", { buddy: "congrats" }); // Confetti
<Callout tone="warn" title="Last update 12 min ago" buddy /> // Snooze
// On a Button: pick who peeks over it.
<Button variant="tomato" buddy buddyMood="error">Retry</Button> // BixChange every prop live in the playground.
Buddy| Prop | Type | Default | What it does |
|---|---|---|---|
| moodrequired | "success" | "error" | "stale" | "congrats" | "preview" | "thinking" | none | Which character, and so which state it stands for. |
| className | string | none | Extra class on the character's wrapper. |
| hands | boolean | false | Show two hands gripping the bottom edge (for peeking over things). |
| label | string | none | What the character is telling people, e.g. "Sketch posted". When set, it is announced as an image; leave it out when the words are already next to it (the character is then decorative). |
| size | "sm" | "md" | "lg" | md | sm 56px, md 84px, lg 120px wide. |
| style | CSSProperties | none | Inline styles on the character's wrapper. |
BuddyPeek| Prop | Type | Default | What it does |
|---|---|---|---|
| childrenrequired | ReactNode | none | The thing the character peeks over: a toast, a card, a callout, a button. |
| moodrequired | "success" | "error" | "stale" | "congrats" | "preview" | "thinking" | none | Which character peeks over the edge. |
| className | string | none | Extra class on the wrapper around the character and the content. |
| label | string | none | Read out with the content, e.g. "Sketch posted". Usually leave it out: the content already says it. |
| side | "start" | "end" | start | Which end of the top edge it peeks from. |
| size | "sm" | "md" | "lg" | sm | sm 56px, md 84px, lg 120px wide. |