This is a callout callout.
Callouts
Docspire supports configurable callouts out of the box. By default, it supports the following callouts:
::: callout
This is a callout callout.
:::
::: details
This is a Details callout.
:::
::: note
This is a Note callout.
:::
::: tip
This is a Tip callout.
:::
::: warning
This is a Warning callout.
:::
::: caution
This is a Caution callout.
:::
::: important
This is a Important callout.
:::
::: danger
This is a Danger callout.
:::
::: info
This is a info callout.
:::
Details
This is a Details callout.
This is a Note callout.
This is a Tip callout.
This is a Warning callout.
This is a Caution callout.
This is a Important callout.
This is a Danger callout.
This is a info callout.
You can nest callouts:
::::: note Parent
Parent content
:::: caution Child { .test }
Child content
::: warning Grandchild { test }
Grandchild content
:::
Child content
::::
Parent content
:::::
Parent content
Child content
Grandchild content
Child content
Parent content
You can optionally specify a title, which will override the default title. You can even use Markdown in it!
::: warning Here be **dragons**
This is a note callout with a custom title.
:::
This is a note callout with a custom title.
Callouts can be collapsible, and start off as expanded or collapsed:
::: tip.collapsed If you have a floob
Here’s how to turn it into a flab
:::
::: tip.collapsible If you have a floob
Here’s how to turn it into a flab
:::
If you have a floob
Here’s how to turn it into a flab
If you have a floob
Here’s how to turn it into a flab
You can add modifiers via CSS classes:
::: note { .no-title }
This is a note without a title.
:::
::: note { .no-icon }
This is a note without an icon.
:::
::: note { .no-title .no-icon }
This is a note without a title or an icon.
:::
This is a note without a title.
This is a note without an icon.
This is a note without a title or an icon.
Customization
Docspire comes with a number of callouts out of the box, but you can add your own. These are the default options:
{
default: {
color: 'neutral'
},
types: {
callout: {
icon: false,
title: false
},
details: {
collapsed: true
},
note: {
color: 'green',
icon: 'info',
title: 'Note'
},
tip: {
color: 'green',
icon: 'tip'
},
warning: {
color: 'yellow',
icon: 'warning',
role: 'alert'
},
caution: {
color: 'red',
icon: 'caution',
role: 'alert'
},
important: {
color: 'brand',
icon: 'important'
},
danger: {
extends: 'caution'
},
info: {
extends: 'note',
title: false
}
}
}
default
specifies default options for all callouts, whereas types
specifies what types are available and what their options are.
This is what each option means:
extends
allows you to create aliases of other callout types, with or without overriding some of their options.title
: The default title, orfalse
for none (if notfalse
, a title is auto-generated from the type). If a title is provided in the callout, this is ignored.icon
: The default icon, orfalse
for none (mainly useful as an override)color
: The default color orneutral
for none (mainly useful as an override)collapsed
andcollapsible
allow you to apply these modifiers by default.
Roadmap
Things we want to add to callouts at some point:
dismissible
orclosable
flag to make callouts dismissable (and store it in local storage)- GitHub-style callout syntax
- Predefined appearances
- A way to style callouts as a full-width banner (either flag or heuristic)