# Callout

> An inline message box for supplementary, cautionary or critical notes, with five status variants and a default icon each.

Source: https://docs.cherry.al/components/callout

> For the complete documentation index, see [llms.txt](https://docs.cherry.al/llms.txt).

# Callout

<Preview bleed>
<iframe className="light-only" src="https://v2.cherry.al/preview/callout?theme=light" title="Callout preview" loading="lazy" style={{ width: "100%", height: "446px" }} />
<iframe className="dark-only" src="https://v2.cherry.al/preview/callout?theme=dark" title="Callout preview" loading="lazy" style={{ width: "100%", height: "446px" }} />

```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>
  );
}
```
</Preview>

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](/components/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

<Field value="variant" type='"neutral" | "success" | "warning" | "danger" | "info"'>
  Status color and default icon. Defaults to `"neutral"`.
</Field>

<Field value="title" type="ReactNode">
  Optional bold first line.
</Field>

<Field value="icon" type="ReactNode | null">
  Replaces the variant's icon. Pass `null` for no icon.
</Field>

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.

<Button href="https://github.com/cherry-design-system/react/tree/main/src/components/callout" icon="code" iconPosition="left">
  View Source
</Button>
