Callouts and alerts

Components•4 min read|
|

Use callouts to highlight important information, warnings, tips, and notes. They draw attention to content that readers should not miss.

Basic callout

Style a callout's parts with ::part(): root, icon and content. See Custom CSS.

<wc-callout type="info" title="Good to know"> DocsLit generates a search index automatically on every build. </wc-callout> DocsLit generates a search index automatically on every build.

Callout types

Each type has its own color and default icon. Use type to pick one, and add a title when a heading helps.

Use info callouts for supplementary information that adds context. Use note callouts for general remarks and observations. Use tip callouts for best practices and recommendations. Use warning callouts for potential issues the reader should be aware of. Use error callouts for critical issues that can cause failures. The alias danger looks the same. Use success callouts to confirm that something works as expected. Use check callouts for a verified state or a passing condition. Use launch callouts to announce something new.

Attributes

The visual style and default icon. Options: info, tip, warning, error, danger, success, check, note, launch. danger is an alias of error styling. The heading text displayed at the top of the callout. Inline Markdown works. If omitted, the callout shows only the body content. A custom icon that replaces the one for the type. Use any icon form, or none to hide the icon. The Font Awesome style for a bare icon name: solid, regular or brands. A custom accent color, as a hex value or any CSS color. It tints the border, background, icon and title.

wc-alert is an alias of wc-callout with the same attributes.

Custom icon and color

Pass icon and color, and leave out type, to make a callout that matches your own palette:

<wc-callout icon="rocket" color="#8b5cf6" title="Launch day"> A custom icon and color. </wc-callout> <wc-callout icon="fa-brands fa-github" color="#0ea5e9"> Any icon form works, including Font Awesome classes. </wc-callout> <wc-callout type="note" icon="none"> A note with no icon. </wc-callout> A custom icon and color. Any icon form works, including Font Awesome classes. A note with no icon.

Without a title

You can omit the title for a simpler presentation:

<wc-callout type="tip"> Write one idea per sentence. Your readers will thank you. </wc-callout> Write one idea per sentence. Your readers will thank you.

Markdown inside callouts

Callouts support full Markdown content including bold, italic, lists, links, and code:

<wc-callout type="info" title="Supported Markdown"> You can use: - **Bold** and *italic* text - `inline code` and [links](../getting-started/introduction) - Nested lists and other formatting </wc-callout>

You can use:

  • Bold and italic text
  • inline code and links
  • Nested lists and other formatting

Banners

Banners are notices that span the full width of the content area. Use them for announcements or temporary notices inside a page. For a site-wide banner above the navbar, see the announcement banner.

<wc-banner type="info" dismissible> DocsLit v0.3.0 is now available. See the changelog for details. </wc-banner> DocsLit v0.3.0 is now available. See the changelog for details. Scheduled maintenance on Saturday. Builds may be delayed. A solid brand color, with its own shade in dark mode. The visual style. Options: info, warning, error, critical, success, neutral. Show a close button. A dismissed banner stays hidden until its text changes. A solid background color with white text, in light mode and, unless dark-color is set, in dark mode. A solid background color used in dark mode. A leading icon.

Badges

Inline badges for labeling and categorization:

<wc-badge>Default</wc-badge> <wc-badge variant="success" icon="check" shape="pill">Stable</wc-badge> <wc-badge variant="warning">Beta</wc-badge> <wc-badge variant="danger" outlined>Deprecated</wc-badge> <wc-badge variant="info" size="sm">New</wc-badge> <wc-badge variant="purple" minimal>Enterprise</wc-badge> <wc-badge variant="neutral" disabled>Retired</wc-badge>

Default Stable Beta Deprecated New Enterprise Retired

The color. Options: default, success, warning, orange, danger, error, info, neutral, purple, note, tip, launch, check, white, surface. The badge text. When omitted, the text between the tags is used. The size. Options: xs, sm, md, lg. The corner shape. Options: rounded, pill. A leading icon. A transparent background with a border. A very subtle background and no border. A reduced-opacity look for retired or unavailable items.

When to use each type

Type Use for
info Supplementary context, prerequisites
tip Best practices, recommendations
warning Potential gotchas, compatibility notes
error Breaking changes, critical requirements
success Confirmed behavior, completed steps
check A verified state, a passing condition
launch New features and announcements
note General remarks, asides