Callouts

Highlight important context with tip, warning, note, danger, and success callouts.

Callouts are the most-used component in Dokly. They draw the reader's eye to information that would otherwise blend into the prose — a warning, a tip, a side note.

Examples#

Pro tip

Use callouts sparingly. If every other paragraph is a callout, none of them are.

Watch out

This action is destructive and cannot be undone.

Note

Custom domains require a Pro plan or higher.

Stop

Don't run this command in production without a backup.

Nice

Your project is now live at acme.dokly.co.

Props#

PropValuesDefaultDescription
typetip, info, note, warning, caution, danger, error, successinfoVisual style and icon
titlestringnoneBold title above the body
childrencontentrequiredAnything — paragraphs, lists, code, even other components

Source#

MDX
<Callout type="tip" title="Pro tip">
  Use callouts sparingly. If every other paragraph is a callout, none of them are.
</Callout>

When to use which type#

TypeWhen
tipOptional advice that improves the result
info / noteContext the reader needs but isn't critical
warning / cautionSomething might go wrong
danger / errorSomething will go wrong if you don't pay attention
successConfirmation of a successful state

note is an alias for info, caution for warning, error for danger. Use whichever reads better in context.

Nesting#

Callouts can contain anything — including other components.

With code inside

Run this to verify:

Bash
curl https://api.example.com/health

Don't nest callouts inside callouts. It looks bad and confuses the reader.

Accessibility#

Each callout has an icon, but the icon is decorative — the type is conveyed by the title and surrounding context, not the icon alone. Screen readers announce the title as a heading.

Where next#