Admonitions (AKA call-outs) are a great way to interject a post with tips, warnings, questions, and other items related to your content.
Leaf vs Container¶
Admonitions come in two varieties: leaves and containers. Leaf admonitions have a title while container admonitions include a title and a body.
Structure¶
Leaf admonitions have the following structure:
- two colons
::
- followed by the type (e.g.
info
) - followed by the title in square brackets (e.g.
[Admonitions are cool]
) - followed by the properties in curly braces (e.g.
{ icon="dog" }
)
Structure¶
Container admonitions have the following structure:
- three colons
:::
- followed by the type (e.g.
info
) - followed by the title in square brackets (e.g.
[Admonitions are cool]
) - followed by the properties in curly braces (e.g.
{ icon="dog", collapse=true }
) - followed by the body content
- followed by three colons
:::
Type¶
A quote
Here's a quote
Some help
Here's some help
A tip
Here's a tip
A warning
Here's a warning
An idea
Here's an idea
An answer
Here's an answer
A success
Here's a success
An abstract
Here's an abstract
A summary
Here's a summary
Some info
Here's some information
A note
Here's a note
A question
Here's a question
A hint
Here's a hint
Something important
Here's something important
An error
Here's an error
Something dangerous
Here's something dangerous
A bug
Here's a bug
An example
Here's an example
Title¶
You can include a title for your admonition by writing it inside square brackets. This is sometimes refered to as the tag label.
Here's my title
What do you think?
You can even write titles using Markdown.
Here's a title with markdown
Cool, eh?
Icon¶
Each admonition has its own default Lucide icon that you can change via the icon
property.
Gripe
Something can't be very unique. It's either unique or it isn't!
You can browse the full list of icons at lucide.dev/icons
Collapse¶
You can make a container admonition collapsible by adding the collapse
property in curly braces, setting it equal to true
or false
to specify the default state.
Default expanded¶
Here's a collapsible admonition that's expanded by default.
Answer
The answer is 42.
Nesting¶
Container admonitions can be nested by adding an extra colon to the parent tag. (The same trick applies to other container elements like popovers and blur screens.)
Question
Why did the chicken cross the road?
Answer
To get to the other side