Skip to Content
Fumadocs

Remark Admonition

Use Admonition in Fumadocs

In Docusaurus, there's an Admonition syntax. For people migrating from Docusaurus, you can enable this remark plugin to support the Admonition syntax.

Usage

It requires the directive syntax. On unified, install remark-directive:

npm install remark-directive

Sätteri parses directives with its directive feature, which Fumadocs MDX enables by default.

source.config.ts
import remarkDirective from 'remark-directive';
import { remarkDirectiveAdmonition } from 'fumadocs-core/mdx-plugins';
import { defineConfig } from 'fumadocs-mdx/config';

export default defineConfig({
  mdxOptions: {
    remarkPlugins: [remarkDirective, remarkDirectiveAdmonition],
  },
});

Example

:::tip[This is a `title`]

Hello World

:::

:::warning

Hello World

:::

When to use

We highly recommend using the JSX syntax of MDX instead. It's more flexible, some editors support IntelliSense in MDX files.

<Callout type='warn'>

Hello World

</Callout>

How is this guide?

Last updated on