Callouts
Semantic notices for a caveat, a tip or a danger, with the five types and when each is honest.
- #authoring
- #components
- #accessibility
A callout lifts one remark out of the prose and announces what kind of remark it is. The type is semantic rather than decorative. Each one carries its own icon, its own colour, and the ARIA role that matches its urgency, so a screen reader hears a warning as a warning.
The cost of a callout is that it interrupts. A page of them reads as a page of interruptions and the reader starts skipping them, which is exactly the content that could not afford to be skipped.
The types
info and caution are accepted as aliases for note and warning, so a
document pasted from elsewhere keeps rendering.
Compact
A one-sentence aside does not need a heading of its own. compact drops the
title row and renders on a single line:
Props
<Callout />
type?note | tip | warning | danger | important
Which notice to show. info and caution are accepted as aliases.
- Default
note
title?string
Replaces the default heading for the chosen type.
compact?boolean
Renders on one line without a heading, for a short aside.
- Default
false
Choosing one
- A quotation is a blockquote, not a callout.
- A consequence the reader must know before acting is a
warning; an unrecoverable one isdanger. - If the sentence would survive in the paragraph above, leave it there.