Directives
Directives are Markdown primitives powered by the plugin directive registry. They keep content portable while giving the renderer enough structure for components such as callouts, details, tables of contents, steps, cards, buttons, badges, tabs, sections, columns, and cells.
Public Directives
:::callout:::details:::toc:::steps:::cards:::card::button:::buttons::badge:::badges:::tabs:::tab:::docs-table(and::docs-tableabove a pipe table):::entry:::index:::related::usage(and the```usagefence):::exchange:::section:::2col:::3col:::cell- Inline roles:
:kbd,:since,:deprecated,:ref,:fact
Basic Syntax
1:::callout[Read this first]{variant="warning"}2Content stays Markdown.3:::
Use [Label] for visible directive titles, and put attributes in braces. Expanded multiline attributes are preferred when a directive has more than one or two attributes:
1:::card[Markdown Field]{2 href="/getting-started/fields-and-blocks"3 theme="cyan"4}5Portable Markdown content.6:::
The older title="" form remains valid for existing Markdown, but snippets and docs prefer [Label].
Quoted values are supported. Boolean-style attributes are supported where a directive defines them, such as open="true" on details, numbered on card steps, or disabled on a tab.
Rendering Guarantees
- Directives render server-side.
- Directives do not require client hydration except for progressive tab, copy-button and reference-table behavior; without it every row and panel stays readable.
- Nested Markdown remains Markdown.
- Unknown or malformed attributes warn where possible and fall back safely.
- Stable selectors are emitted for testing and styling, such as
data-directive,data-theme, andvl-md-*classes.
Markdown-In-Markdown Examples
Use four backticks when documenting Markdown that itself contains fenced code blocks:
1````md2:::steps{3 variant="cards"4 stepTheme="glass"5}6 7### Install8 9```bash10pnpm add payload-markdown11```12 13### Configure14 15:::callout[Keep config in source]{variant="tip"}16Authors select themes by name. They do not need to write Tailwind classes.17:::18 19:::20````
The outer fence shows the literal Markdown. The inner fence remains part of the example content.
Heading Anchors
Headings render with deterministic IDs:
1## Install2 3## Install
Conceptual output:
1<h2 id="install">Install</h2>2<h2 id="install-1">Install</h2>
The table of contents directive uses those same heading IDs.
Directive Pages
Callout
Notes, tips, warnings, danger messages, and success states.
Details
Native disclosure blocks for optional or advanced content.
Table Of Contents
Generated page-local navigation from headings.
Steps
Ordered flows, install procedures, and card-based tutorials.
Cards
Card grids and standalone card content.
Buttons
Link buttons and grouped primary links with local SVG icons.
Badges
img.shields.io badges with curated resolvers and strict Shields escape hatches.
Tabs
Accessible tabbed content with server-rendered panels.
Reference Tables
Options, config keys, commands and other reference material with anchors, typed values and details.
Entry Index
Generated indexes of a page's commands, config keys and deprecated entries.
Related Links
Lists of links rendered as compact cards.
Inline Roles
Key caps, version badges, links to entries and source-bound values inside sentences and cells.
Usage
Command-line synopses that wrap at group boundaries and link options to their rows.
Exchange
A request and its responses side by side, with status and method badges.
Layout
Sections, two-column grids, three-column grids, and explicit cells.