Callout
A note, a tip, an important point, a warning or a caution.
Preview
Add to your site
npx docs-sitekit add calloutIt writes these files, and keeps a file you changed:
src/presentation/components/site/callout.tsx
It requires these entries of the registry, which add restores first:
Props
Built from the TypeScript types and the TSDoc comments of the component, so they cannot drift from the code.
| Key | Type | Default | Allowed values | Description |
|---|---|---|---|---|
kind | string | "note" | "note", "caution", "important", "tip", "warning" | Which of the five: note, tip, important, warning or caution. It sets the icon, the label and the tone. |
title | string | - | - | A title that replaces the name of the kind. |
children | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | required | - | The text of the callout. |
className | string | - | - | Classes added to the callout. |
Variants and states
The five kinds
Note, tip, important, warning and caution. The same five come from markdown as > [!NOTE] and the others.
With a title
A title replaces the name of the kind.
About
A highlighted note inside a page, with five kinds. The same five also come from markdown as > [!NOTE] and the others, see Callouts; both look the same.
Accessibility
- It is an
<aside>withrole="note", and it is a note, not an alert: nothing is announced when it appears. - The kind is written in the text (Note, Tip, Important, Warning, Caution), so the color of the edge and of the label is not the only cue.
- The icon is
aria-hidden. - The tones are the tokens
brand,success,warn,fg-brightanddestructive, and the label uses the same tone as the edge. All reach AA on the callout in both themes.
Source
Edit this page
Last updated