Callout
A strip torn off a pad. Use it for things people need to know before they act, not for decoration.
Server ComponentWCAG AASince v0.1
Live example
Two friends are on this board
Rosa and Jun are both sketching right now.
Not saved yet
Save your sketch before you close the tab.
Couldn’t reach the server
Your sketch is saved on this device.
Sketch received
Reference number 24-1187.
import { Callout, Button } from "@plop-ui/react";
<Callout tone="warn" title="Not saved yet">
Save your sketch before you close the tab.
</Callout>
<Callout tone="error" title="Couldn't reach the server" action={<Button size="sm" variant="plain">Try again</Button>}>
Your sketch is saved on this device.
</Callout>Change every prop live in the playground.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| titlerequired | ReactNode | none | The headline, lettered in Sketchpop. |
| action | ReactNode | none | A button under the text, e.g. "Try again". |
| buddy | boolean | BuddyMood | none | A character peeks over the strip: true picks one for the tone (Specs, Snooze, Bix, Pip), or name a mood. |
| children | ReactNode | none | Body text under the title. |
| className | string | none | Extra class on the strip. |
| headingLevel | 2 | 3 | 4 | 3 | Heading level of the title. |
| role | "alert" | "status" | none (it is just content) | alert for errors that need attention right away. |
| tilt | number | -0.5 | Rotation in degrees. |
| tone | "success" | "error" | "info" | "warn" | info | Sets the color and icon: info, warn, error or success. |
Use it well
DoPut the callout right before the action it's about.
Don'tStack callouts at the top of a page. People stop reading them.
Accessibility
- Every tone has an icon and a title; color only repeats it.
- Pass role="alert" for errors that need attention right away.