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

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

PropTypeDefaultDescription
variant'info' | 'tip' | 'warning''info'Kind of aside.
headingReactNode—Optional bold heading.
childrenReactNode—Body content (required).
variantLabelstring'Note' | 'Tip' | 'Warning'Accessible name of the variant icon. Pass a translation to localize it, or '' to make the icon decorative.
...restHTMLAttributes<HTMLDivElement>—Forwarded to the root, including role and aria-*.

Web Components@ghds/web-components

PropTypeDefaultDescription
variant'info' | 'tip' | 'warning''info'Kind of aside (reflected).
headingstring—Optional bold heading.
variant-labelstring'Note' | 'Tip' | 'Warning'Accessible name of the variant icon (property variantLabel). Set a translation to localize it, or '' to make the icon decorative.
default slotNode—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>

Live Demo

React @ghds/react

Web Components @ghds/web-components

An info aside. A tip aside. A warning aside.