Skip to content

Info Boxes ​

Info boxes are colored callouts that set a block of content apart — a note, a confirmation, a caution, or an error. They are written with the ::: block directive: a keyword on the opening line gives the box its meaning, and a closing ::: ends it.

The Rich Text Editor inserts them from the Add Content menu (Info Hint, Success Hint, and Warning Hint), but you can also type them directly. This is useful when importing Markdown content or when editing several boxes at once.

The Add Content menu with the Info Hint, Success Hint and Warning Hint items
The Info, Success and Warning Hint items in the Add Content menu.

Syntax ​

The keyword follows the opening :::, on the same line. The closing ::: sits on its own line.

markdown
::: info
This is an info box.
:::

Available Box Types ​

Each type has its own accent color. All types adapt to the active theme (light, dark, and contrast themes).

KeywordMeaningToolbar menu item
infoNeutral information or a note.Info Hint
successA positive confirmation.Success Hint
warningA caution or a non-critical issue.Warning Hint
errorA critical error or invalid content.— (type it manually)
dangerSynonym of error.— (type it manually)

Content Inside a Box ​

The content inside a box is regular Markdown: headings, lists, links, bold and italic text, and images all render normally.

markdown
::: success
### Your response was saved

You can safely close this page — your answers were submitted.
:::

Deprecated: <gitbook-hint> Widgets ​

Content created with earlier versions of the editor may contain <gitbook-hint> tags, for instance <gitbook-hint type="info">…</gitbook-hint>. The widget is deprecated and the editor no longer inserts it. The editor preview still renders it, but deployed surveys treat it as an unknown element, so the box styling is lost there. Replace it with the ::: directive.

Deprecated tagReplacement
<gitbook-hint type="info">…</gitbook-hint>::: info … :::
<gitbook-hint type="success">…</gitbook-hint>::: success … :::
<gitbook-hint type="warning">…</gitbook-hint>::: warning … :::
<gitbook-hint type="danger">…</gitbook-hint>::: error … :::

Customizing a Box (Advanced) ​

The boxes are styled with CSS tokens and follow the active theme by default. When you need a different accent, background, spacing, or corner radius, override the --md-hint-* tokens with an HTML container or an inline style:

html
<div class="info" style="--md-hint-background: var(--color-primary-container)">
  This info box uses the primary container color as its background.
</div>
TokenDefaultDescription
--md-hint-colorColor of the box typeAccent bar color.
--md-hint-background--color-surface-container-highBox background color.
--md-hint-padding--space-mediumInner padding of the box.
--md-hint-radius6pxCorner radius of the accent side.
--md-hint-color-info--color-primaryAccent color of info boxes.
--md-hint-color-success--color-successAccent color of success boxes.
--md-hint-color-warning--color-warningAccent color of warning boxes.
--md-hint-color-error--color-errorAccent color of error and danger boxes.