← All posts

Complete Guide to Admonitions

Master the use of admonitions (callout boxes) to enhance your blog posts with visual emphasis

What are Admonitions?

Admonitions are special callout boxes that help emphasize important information in your posts. They come in different types with distinct colors and icons to convey different types of messages.

Available Admonition Types

This blog supports 6 types of admonitions, each with a unique purpose and visual style.

Note (Blue)

Use for general information, tips, or supplementary details.

Note

This is a note admonition. It’s perfect for providing additional context or highlighting interesting facts that supplement the main content.

Syntax:

:::note
Your note content here.
:::

Tip (Green)

Use for helpful suggestions, best practices, or pro tips.

Tip

This is a tip admonition. Use it to share helpful advice, shortcuts, or best practices that can improve the reader’s experience or workflow!

Syntax:

:::tip
Your tip content here.
:::

Info (Cyan)

Use for informational messages or FYI content.

Info

This is an info admonition. Perfect for sharing factual information, definitions, or explanatory content that readers should know.

Syntax:

:::info
Your info content here.
:::

Warning (Orange)

Use for cautions, potential pitfalls, or things to watch out for.

Warning

This is a warning admonition. Use it to alert readers about potential issues, deprecated features, or situations that require caution.

Syntax:

:::warning
Your warning content here.
:::

Danger (Red)

Use for critical warnings, breaking changes, or severe issues.

Danger

This is a danger admonition. Reserve this for critical warnings, breaking changes, security issues, or scenarios that could cause serious problems.

Syntax:

:::danger
Your danger content here.
:::

Success (Green)

Use for confirmations, completed tasks, or positive outcomes.

Success

This is a success admonition. Great for showing completion, success messages, or positive results!

Syntax:

:::success
Your success content here.
:::

Advanced Features

Custom Titles

You can customize the title of any admonition:

Note

Custom Title

This note has a custom title instead of the default “Note”.

Syntax:

:::note[Custom Title]
Your content here.
:::

Multiple Paragraphs

Admonitions support multiple paragraphs and complex formatting:

Tip

This is the first paragraph with some bold text.

This is the second paragraph with italic text.

  • List item 1
  • List item 2
  • List item 3

And even code blocks:

```javascript console.log(‘Hello from admonition!’); ```

Syntax:

:::tip
First paragraph.

Second paragraph.

- List items
- Work too

\`\`\`javascript
console.log('Code works!');
\`\`\`
:::

Collapsible Admonitions

All admonitions are collapsible by default! Click the title to expand/collapse the content.

Info

Click the title above to see how this works! The content can be toggled on and off, making it easy to hide details until needed.

Use Cases & Examples

Documentation

Note

API Version: This endpoint is available in API v2.0 and later.

Tutorials

Tip

Pro Tip: Always test your changes locally before deploying to production!

Warnings

Warning

Deprecated: This method will be removed in version 3.0. Please use the new newMethod() instead.

Critical Issues

Danger

Security Alert: Never commit API keys or sensitive credentials to version control!

Success Messages

Success

Setup Complete: Your development environment is now ready to use!

Best Practices

When to Use Each Type

TypeUse ForExamples
NoteGeneral info, contextBackground information, interesting facts
TipHelpful suggestionsBest practices, shortcuts, optimizations
InfoFactual informationDefinitions, explanations, clarifications
WarningCautionsPotential issues, deprecations, gotchas
DangerCritical warningsSecurity issues, breaking changes, data loss
SuccessPositive outcomesCompletions, achievements, confirmations

Don’t Overuse

Warning

While admonitions are great for emphasis, using too many can make your content look cluttered and reduce their impact.

Good practice:

  • Use 2-4 admonitions per post
  • Only for truly important information
  • Mix types appropriately

Bad practice:

  • Using admonitions for every paragraph
  • Multiple admonitions of the same type in a row
  • Using the wrong type for the content

Keep Content Concise

Tip

Admonitions work best with concise, focused content. Keep them to 2-3 sentences when possible.

Styling & Appearance

Light Mode

All admonitions automatically adapt to light mode with appropriate colors:

  • Soft, easy-on-the-eyes backgrounds
  • Distinct border colors
  • High contrast text

Dark Mode

In dark mode, admonitions use:

  • Darker, muted backgrounds
  • Brighter border colors for visibility
  • Optimized text contrast

Icons

Each type has a unique Font Awesome icon:

  • 💡 Note: fa-lightbulb
  • 🔥 Tip: fa-fire
  • ℹ️ Info: fa-info-circle
  • ⚠️ Warning: fa-exclamation-triangle
  • Danger: fa-exclamation-circle
  • Success: fa-check-circle

Nesting & Combinations

Admonitions with Lists

Note

You can include lists inside admonitions:

  1. First item
  2. Second item
  3. Third item

Or unordered lists:

  • Item A
  • Item B
  • Item C

Admonitions with Code

Tip

Here’s how to install dependencies:

```bash npm install npm run dev ```

Don’t forget to check the logs for any errors!

Info

For more information, check out:

Common Mistakes

Wrong Syntax

Wrong:

::note
Missing colon!
::

Correct:

:::note
Three colons!
:::

Unclosed Admonitions

Wrong:

:::warning
Missing closing tag

Correct:

:::warning
Properly closed
:::

Incorrect Type Names

Wrong:

:::error
Type doesn't exist
:::

Correct:

:::danger
Use existing types
:::

Real-World Examples

Installation Instructions

Tip

Before You Start

Make sure you have Node.js 18+ installed on your system.

Breaking Changes

Danger

Breaking Change in v2.0

The oldMethod() has been completely removed. Update your code to use newMethod() before upgrading.

Feature Availability

Info

New Feature

This feature is available starting from version 1.5.0.

Summary

Success

You’ve learned everything about admonitions! Start using them in your posts to create engaging, well-structured content.

Quick Reference:

  • :::note - General information (Blue)
  • :::tip - Helpful suggestions (Green)
  • :::info - Factual information (Cyan)
  • :::warning - Cautions (Orange)
  • :::danger - Critical warnings (Red)
  • :::success - Positive outcomes (Green)

Happy writing! ✨

Comments

Comments are moderated and will be approved shortly.

Loading comments...

Leave a comment