Skip to content
Admonitions
Github.com

Admonitions

What it is

Void styles the standard MkDocs admonition extension, plus collapsible ??? (details) blocks and inline variants. Every type maps to a themed accent color and a small icon in the title.

When to use it

Use admonitions for short, self-contained callouts that deserve visual weight β€” a warning, a tip, a takeaway, a caution. Keep them short; if the content runs longer than a few sentences, it probably belongs in prose instead. Prefer collapsible details when the extra context is optional, and reserve inline for tiny asides that should float beside text.

In Markdown

Admonitions are plain Markdown. The type keyword follows !!! and the body is indented:

!!! note
    A note uses the accent purple color.

??? renders a collapsible block, closed by default. Append + to default it to open:

??? note "Expand me"
    Hidden until expanded.

The inline class floats the block beside content:

!!! note inline
    Floats to the left of the prose.

Configuration

Admonitions come from the Markdown extensions, already enabled in the theme:

markdown_extensions:
  - admonition
  - pymdownx.details
  - pymdownx.superfences

To switch the visual layer off site-wide, use the theme option. Custom types stay available via CSS regardless:

theme:
  void:
    admonitions:
      show: false        # default true β€” hides the styled layer

Live preview / screenshot

Note / Info / Example

!!! note
    A generic note.

Note

A generic note.

!!! info
    Additional information.

Custom title

Custom titles are supported.

!!! example
    An example block.

Example

An example block.

Abstract / Summary / TLDR

!!! abstract "Summary"
    A condensed takeaway.

Summary

A condensed takeaway.

Tip / Hint / Question / FAQ

!!! tip
    A helpful tip.

Tip

A helpful tip.

!!! question
    A question worth asking.

Question

A question worth asking.

Success / Done / Check

!!! success
    Everything worked.

Success

Everything worked.

Warning / Caution / Attention

!!! warning
    Watch out.

Warning

Watch out.

Danger / Error / Failure / Bug / Important

!!! danger
    This is destructive.

Danger

This is destructive.

!!! bug
    Known defect.

Bug

Known defect.

!!! important
    Really important requirement.

Important

Really important requirement.

Quote

!!! quote
    "Less, but better." β€” Dieter Rams

Quote

"Less, but better." β€” Dieter Rams

Collapsible (details)

??? note "Expand me"
    Hidden until expanded.
Expand me

Hidden until expanded.

???+ danger
    Open by default and collapsible.
Danger

Open by default and collapsible.

Inline

!!! note inline
    Floats to the left in this layout.

Note

Floats to the left in this layout.

Paragraph text that wraps around the inline admonition demonstrates the floating behavior. Copy continues to flow around the floated box, letting you place short callouts against prose without breaking the reading flow.

Under the hood

  • Markdown output is the standard <aside class="admonition note"> / details markup; Void restyles it in components.scss and wires the type color + icon through the --void-icon password-color token.
  • The active type's title bar and icon read from theme.void.admonitions.types (color / icon per type) β€” empty values fall back to the built-in palette.
  • Disabling the component sets data-md-void-admonitions="false" on the root element, which stops the icon/color layer without touching the underlying extension output.

Accessibility notes

  • The type is conveyed by both color and an icon, and the title text names the kind ("Warning:", "Danger:"), so meaning never relies on color alone.
  • Collapsible blocks are native <details>/<summary> elements β€” keyboard focus and toggling work without custom scripting.
  • Keep body text at normal contrast; the accent-colored title is a label, not body copy.