Browse the docs

Buddy

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.

Server componentWCAG AANew

Live example

  • Pipmood="success"Cheers when something worked: saved, sent, copied.
  • Bixmood="error"Winces when something failed and needs another try.
  • Snoozemood="stale"Dozes off when data is out of date or still waiting.
  • Confettimood="congrats"Throws a little party for milestones: zine finished, all shipped.
  • Specsmood="preview"Peeks at previews, drafts and things worth a look.
  • Hummood="thinking"Mulls it over while something loads or works.
Copied to clipboard
Couldn't send. Saved for later.
Zine finished. Nice work!

Last update 12 min ago

Drafts may be out of date. Pull to refresh.
#1042 · Draft

Cat in a teacup, take two

Not posted yet. Give it a title before you publish.
Preview

Change every prop live in the playground.

Props

Buddy

PropTypeDefaultWhat it does
moodrequired"success" | "error" | "stale" | "congrats" | "preview" | "thinking"noneWhich character, and so which state it stands for.
classNamestringnoneExtra class on the character's wrapper.
handsbooleanfalseShow two hands gripping the bottom edge (for peeking over things).
labelstringnoneWhat 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"mdsm 56px, md 84px, lg 120px wide.
styleCSSPropertiesnoneInline styles on the character's wrapper.

BuddyPeek

PropTypeDefaultWhat it does
childrenrequiredReactNodenoneThe thing the character peeks over: a toast, a card, a callout, a button.
moodrequired"success" | "error" | "stale" | "congrats" | "preview" | "thinking"noneWhich character peeks over the edge.
classNamestringnoneExtra class on the wrapper around the character and the content.
labelstringnoneRead out with the content, e.g. "Sketch posted". Usually leave it out: the content already says it.
side"start" | "end"startWhich end of the top edge it peeks from.
size"sm" | "md" | "lg"smsm 56px, md 84px, lg 120px wide.

Use it well

DoLet one character stand for one state everywhere, so people learn to read it: Bix always means something failed.
Don'tUse a character as the only signal. Say it in words too; the character just makes it quicker to read.

Accessibility

  • Decorative by default (aria-hidden); the words next to it carry the message.
  • Pass label to announce it as an image when it stands alone.
  • Pop, wince and confetti play once; Snooze's z's and Hum's bubbles keep going while the state lasts. Everything holds still under reduced motion.
Five stamps!

All aboard.

You took the whole tour. Here's Holo Pip, a foil sticker for riders who finish. It's in your playground tray now, for good.