Callout
A hand-drawn static aside for notes, tips, and caveats in documentation content.
Overview
A Callout is a boxed aside that sets a note, a tip, or a caveat apart from the surrounding
long-form content — a docs page, a guide, a changelog. It is static: it is part of the content, not
a reaction to something the user did. For task or page status, use an
Alert; for transient feedback, use a
Toast.
Anatomy
A sketchy box (@ghds/sketch-core) with a variant-coloured outline and icon, an optional bold
heading, and a body. There is no dismiss button.
Variants & States
| State | Status | Notes |
|---|---|---|
| Info | Implemented | Neutral supporting information. Blue outline, info icon. |
| Tip | Implemented | A recommendation or shortcut. Its own purple hue (not a recoloured info), star icon. |
| Warning | Implemented | A caveat or something easy to get wrong. Amber outline, warning icon. |
| Dismissible | Not implemented | Never — a Callout is content. Use an Alert for dismissible messages. |
Usage
Do
- Use a Callout for asides inside docs and long-form content.
- Pick the variant by intent: info for context, tip for a recommendation, warning for a pitfall.
- Give it a short heading that names the point ("Recommended fonts").
Don't
- Don't use a Callout to report the result of an action — use an Alert or a Toast.
- Don't stack several Callouts in a row; fold them into the main text instead.
- Don't rely on colour alone; the icon and heading carry the meaning too.
Accessibility
- React and Web Components: the root has
role="note"— content that is parenthetical to the main content. It is never a live region (norole="status"/"alert"), so screen readers read it in document order instead of announcing it. - The outline and icon use themed status accents (
sys.color.border.*/sys.color.icon.*) that keep at least 3:1 against every surface in light and dark themes. The heading and body text meet 4.5:1. - The variant icon has an accessible name (
Note,TiporWarningby default), so screen readers announce the kind of aside with or without a heading. SetvariantLabel(React) or thevariant-labelattribute (Web Components) to a translated word to localize it, or to an empty string to keep the icon decorative when the heading already names the variant. - React: pass
role/aria-labelto override the default role or name the aside. - Web Components: set a
role/aria-labelattribute on<gh-callout>to override the default role (exposed throughElementInternals) or name the aside. - See the Accessibility Guide.
Content
An optional short heading plus one or two sentences. The body accepts rich content (links, inline code, a short list).
Props API
React@ghds/react
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'info' | 'tip' | 'warning' | 'info' | Kind of aside. |
heading | ReactNode | — | Optional bold heading. |
children | ReactNode | — | Body content (required). |
variantLabel | string | 'Note' | 'Tip' | 'Warning' | Accessible name of the variant icon. Pass a translation to localize it, or '' to make the icon decorative. |
...rest | HTMLAttributes<HTMLDivElement> | — | Forwarded to the root, including role and aria-*. |
Web Components@ghds/web-components
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'info' | 'tip' | 'warning' | 'info' | Kind of aside (reflected). |
heading | string | — | Optional bold heading. |
variant-label | string | 'Note' | 'Tip' | 'Warning' | Accessible name of the variant icon (property variantLabel). Set a translation to localize it, or '' to make the icon decorative. |
default slot | Node | — | Body content. |
React Native has no Callout yet.
Code examples
// React — @ghds/react
import { Callout } from '@ghds/react/callout';
<Callout variant="tip" heading="Recommended fonts">
Load the web fonts with Fontsource in your app.
</Callout>;
<!-- Web Components — @ghds/web-components -->
<script type="module">
import '@ghds/web-components/callout';
</script>
<gh-callout variant="tip" heading="Recommended fonts">
Load the web fonts with Fontsource in your app.
</gh-callout>