The transformMarkdownBlockquoteCallouts plugin is a Remark plugin that enables GitHub-style callout blocks in markdown. It transforms blockquotes with special markers (like > [!NOTE]) into HTML blockquotes with a data-callout-type attribute, making it easy to style and render callouts in your documentation.
[!NOTE], [!TIP], [!IMPORTANT], [!WARNING], and [!CAUTION] markersdata-callout-type to blockquotes for easy styling| Marker | Attribute Value |
|---|---|
[!NOTE] | note |
[!TIP] | tip |
[!IMPORTANT] | important |
[!WARNING] | warning |
[!CAUTION] | caution |
| Callout Type | Color |
|---|---|
note | Blue |
tip | Green |
important | Purple |
warning | Orange |
caution | Red |
Note
These are the default colors used by GitHub. Colors may vary in your implementation, but try to maintain a similar visual hierarchy.
> [!TIP]
> This is a tip callout. You can use any of the supported callout types:
>
> - [!NOTE]
> - [!TIP]
> - [!IMPORTANT]
> - [!WARNING]
> - [!CAUTION]
>
> The callout marker must be the first text in the blockquote.
Note
This is a note callout. It uses the
[!NOTE]marker and renders with a special style.
Tip
This is a tip callout. Use tips for helpful suggestions or shortcuts.
Important
This is an important callout. Use for critical information.
Warning
This is a warning callout. Use for potential problems or risks.
Caution
This is a caution callout. Use for things users should be careful about.
You can also have multiple paragraphs:
Note
This callout has multiple paragraphs.
The second paragraph is also included in the callout.
Add the plugin to your unified/remark pipeline:
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkRehype from 'remark-rehype';
import rehypeStringify from 'rehype-stringify';
import transformMarkdownBlockquoteCallouts from '@mui/internal-docs-infra/pipeline/transformMarkdownBlockquoteCallouts';
const processor = unified()
.use(remarkParse)
.use(transformMarkdownBlockquoteCallouts)
.use(remarkRehype)
.use(rehypeStringify);
const markdown = `
> [!TIP]
> This is a tip!
`;
const html = await processor.process(markdown);
console.log(html.toString());
This plugin is included by default in the docs-infra markdown pipeline. You can also use it in any unified/remark-based project.
[data-callout-type] attributes for custom styles