How it works
Every colour is mixed from one --_tone per variant, so a brand palette needs only the four --ds tone tokens. Dismissal animates grid-template-rows from 1fr to 0fr together with opacity and margins, then calls onDismiss, so the layout below closes the gap without a jump.
Use it for
- Persistent context on a page: a trial ending, a failed payment, a verified setting.
- Messages that belong next to the content they are about.
Look elsewhere when
- Feedback for an action that just happened: use a toast or snackbar.
- Field errors: show them under the field.
Usage
import { Callout } from './Callout.jsx'
export function TrialNotice({ onHide }) {
return (
<Callout
tone="warning"
title="Trial ends in 3 days"
onDismiss={onHide}
actions={
<>
<button type="button" data-primary>Choose a plan</button>
<button type="button">Remind me later</button>
</>
}
>
Pick a plan to keep your projects and members.
</Callout>
)
}Props
| Prop | Type | Default | What it does |
|---|---|---|---|
tone | 'info' | 'success' | 'warning' | 'danger' | 'info' | Colour and default icon. |
variant | 'soft' | 'outline' | 'soft' | Tinted surface, or a plain surface with a tinted border. |
title | ReactNode | — | One short line. |
children | ReactNode | — | The body text. |
actions | ReactNode | — | Buttons or links; they are styled as tinted text links, and data-primary makes one a filled button. |
icon | ReactNode | false | — | Replace the tone icon, or false to hide it. |
onDismiss | () => void | — | Shows a close button; called after the collapse finishes. |
dismissLabel | string | 'Dismiss' | Accessible name of the close button. |
live | boolean | false | Announce it: role alert for warning and danger, status otherwise. Off, it is a role note. |
Accessibility
- By default the box is a role note; with live it becomes role alert (warning, danger) or status (info, success) so it is announced.
- Tone is carried by an icon and the wording as well as colour.
- The dismiss button has an accessible name and a 32px target; actions have 32px tall hit areas and focus rings.
- With reduced motion it disappears at once.
Motion
Dismiss: grid rows and margins 320ms cubic-bezier(0.65, 0, 0.35, 1), opacity 200ms.
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the component next to your own.
Callout.jsxcallout.csstokens.cssREADME.md
Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.
Templates that include it
In the same category
FeedbackConfetti burst comes with Pro. Its preview shows once you unlock it.
Live pill comes with Pro. Its preview shows once you unlock it.



