Skip to content

Feedback

Callout

tsx
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.

tsx
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.

tsx
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

variant"neutral" | "success" | "warning" | "danger" | "info"

Status color and default icon. Defaults to "neutral".

titleReactNode

Optional bold first line.

iconReactNode | null

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

HookValues
.cherry-calloutRoot element
data-variantneutral, 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.