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.
:::

This is a callout callout.

Details

This is a Details callout.

Note

This is a Note callout.

Tip

This is a Tip callout.

Important

This is a Important 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

Parent 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.
:::

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.
:::
Note

This is a note without a title.

Note

This is a note without an icon.

Note

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:

Roadmap

Things we want to add to callouts at some point: