Skip to Content
Getting startedFoundationsComponentsPackagesTools

Callout

An inline notice that stays beside the thing it is about.

Examples

Playground

Audited a cached crawl from 3 September.

Tone

The tint, edge and icon carry the tone; the copy stays the primary ink in every tone.

neutral
Audited a cached crawl from 3 September.
info
Audited a cached crawl from 3 September.
success
Audited a cached crawl from 3 September.
warning
Audited a cached crawl from 3 September.
error
Audited a cached crawl from 3 September.

Content

Without the glyph, when the copy is the whole notice; and a long notice, where the icon stays on the first line.

no glyph
Sometimes the copy is the whole notice.
long
Audited a cached crawl from 3 September. Pages changed since then are not reflected, so run the crawl again before acting on the contrast findings below.

Install

npx shadcn add @hipuku/callout

Usage

import { Callout } from '@/components/haus/components/Callout'

<Callout tone="warning">Changes are not saved until you publish.</Callout>

API

Callout also takes its element's own attributes and forwards its ref. className lands on the root.

PropTypeDescription
tone"neutral" | "info" | "success" | "warning" | "error"
live"off" | "polite" | "assertive"
iconReact.ReactNodeReplaces the tone's glyph, or removes it with false. vault's version takes an override and uses it, so this is a measured need rather than an anticipated one. Whatever is passed is decorative: the tone is carried by colour and by the copy, never by the glyph alone.

Tones

neutral, info, success, warning and error, each with its own glyph. Replace the glyph with icon, or remove it with icon={false}.

Announcing it

live decides whether a screen reader announces the callout. Pick by how it got there:

liveUse it when
offIt was on the page from the start, such as a caveat or guidance. The default
politeIt appeared in response to something, such as save or validation feedback
assertiveIt appeared and the reader must hear it now. Interrupts whatever is being read

A Callout stays in the page beside what it describes. For a passing message about an event, use Toast.

Accessibility

  • Not interactive. Links inside it keep their place in the tab order.
  • The glyph is decorative: the text must carry the meaning without the colour.

On this page