Containers

Use callout boxes for tips, warnings, and important information

jet-w
5min

Containers

Containers are special callout boxes that help highlight important information.

Basic Syntax

::: type
Content goes here
:::

Container Types

Tip

For helpful suggestions:

::: tip
This is a helpful tip for the reader.
:::
Tip

This is a helpful tip for the reader.

Info

For informational notes:

::: info
Here's some additional information.
:::
Info

Here's some additional information.

Warning

For things to be careful about:

::: warning
Be careful with this operation.
:::
Warning

Be careful with this operation.

Danger

For critical warnings:

::: danger
This action cannot be undone!
:::
Danger

This action cannot be undone!

Note

For general notes:

::: note
A side note for the reader.
:::
Note

A side note for the reader.

Custom Titles

Add a custom title after the type:

::: tip Pro Tip
This container has a custom title.
:::
Pro Tip

This container has a custom title.

::: warning Security Notice
Always validate user input!
:::
Security Notice

Always validate user input!

Rich Content

Containers support full Markdown inside:

::: info Features
This blog supports:
- **Markdown** formatting
- `Code` snippets
- [Links](https://example.com)
:::
Features

This blog supports:

  • Markdown formatting
  • Code snippets
  • Links

Details (Collapsible)

Create expandable sections:

::: details Click to expand
This content is hidden by default.
You can put lots of content here.
:::
Click to expand

This content is hidden by default.

You can put lots of content here.

Details with Code

::: details View the solution
function solve() {
  return 42;
}
:::
View the solution
function solve() {
  return 42;
}

Best Practices

When to Use Containers
  • tip - Helpful suggestions, best practices
  • info - Background information, context
  • warning - Potential issues, things to watch
  • danger - Critical errors, data loss risks
  • note - General observations
  • details - Optional content, long examples
Don't Overuse

Too many containers can be distracting. Use them sparingly for truly important information.

Quick Reference

TypeSyntaxUse Case
tip tipHelpful suggestions
info infoAdditional information
warning warningCautions
danger dangerCritical warnings
note noteSide notes
details detailsCollapsible content

Next: Master Code Blocks for beautiful code snippets.