Callout
import { Callout } from "@cherry-design-system/react";
export function UpgradeNote() {
return (
<Callout variant="warning" title="Heads up">
Back up your tokens before upgrading.
</Callout>
);
}A Callout is a static message box inside the page flow, for supplementary, cautionary or critical notes. It is not a live region: for transient feedback after an action, use a toast. For a site-wide announcement, use Banner.
Examples
Variants
Each variant has its own color and default icon.
import { Callout } from "@cherry-design-system/react";
export function Variants() {
return (
<>
<Callout variant="neutral">A neutral note.</Callout>
<Callout variant="info" title="Info">Tokens update without a re-render.</Callout>
<Callout variant="success" title="Saved">Your changes are live.</Callout>
<Callout variant="warning" title="Warning">This key expires in 3 days.</Callout>
<Callout variant="danger" title="Error">The deploy failed. Check the logs.</Callout>
</>
);
}Custom icon or no icon
icon replaces the variant's icon. Pass null to show none.
import { Callout } from "@cherry-design-system/react";
import { Lightbulb } from "lucide-react";
export function Icons() {
return (
<>
<Callout variant="info" icon={<Lightbulb />} title="Tip">
Press Shift+Enter for a new line.
</Callout>
<Callout icon={null}>A callout without an icon.</Callout>
</>
);
}Properties
Status color and default icon. Defaults to "neutral".
Optional bold first line.
Replaces the variant's icon. Pass null for no icon.
Callout renders a <div>, forwards its ref to it and passes every other <div> attribute through. It has no client JavaScript, so it is safe in Server Components.
Styling
| Hook | Values |
|---|---|
.cherry-callout | Root element |
data-variant | neutral, info, success, warning, danger |
| Parts | .cherry-callout__icon, __content, __title, __body |
Status variants read the matching --cherry-<status>-bg, -fg and -border tokens. neutral reads --cherry-bg-subtle and --cherry-border-default.
Accessibility
The icon is decorative. The title or text must state the tone ("Warning", "Error"), since color alone does not reach every reader.