Layout directives organize content into structured components like card grids, tabs, and collapsible sections.
Key Terms
- Card Grid
- A container directive (
{cards}) that creates a responsive grid of card components. Supports flexible column layouts and responsive breakpoints. - Card
- An individual card component (
{card}) within a card grid. Can include icons, links, images, colors, and footer content. - Tab Set
- A container directive (
{tab-set}) that groups multiple tab items together. Provides tabbed navigation for organizing related content. - Tab Item
- An individual tab (
{tab-item}) within a tab set. Contains content for one tab panel. - Dropdown
- A collapsible section directive (
{dropdown}) that can be expanded or collapsed. Useful for optional or advanced content to reduce cognitive load. - Grid
- A Sphinx-Design compatibility directive (
{grid}) that converts to card grids internally. Prefer{cards}for new content.
Cards
Create responsive card grids for navigation, feature highlights, or content organization.
Card Grid ({cards})
Container for multiple cards with responsive column layout. Use:::{/cards}to close.
Syntax:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Options:
:columns:- Column layout:auto(default) - Auto-fit based on card width2,3,4- Fixed columns1-2-3- Responsive (mobile-tablet-desktop)1-2-3-4- Responsive with wide breakpoint
:gap:- Gap between cards:small,medium(default),large:style:- Card style:default,minimal,bordered:variant:- Variant:navigation(default),info,concept:layout:- Card layout:default,horizontal,portrait,compact
Individual Card ({card})
Single card within a cards container.
Syntax:
1 2 3 4 5 6 7 8 9 10 11 12 | |
Options:
:icon:- Icon name (e.g.,book,code,rocket):link:- Card link URL (path, slug, orid:ref-target):color:- Color:blue,green,red,yellow,orange,purple,gray,pink,indigo:image:- Header image URL:footer:- Footer text (or use+++separator):pull:- Auto-fetch fields from linked page:title,description,icon,image,date,tags:layout:- Override grid layout:horizontal,portrait,compact
Footer Separator:
1 2 3 4 5 | |
Examples
Basic Card Grid:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
Responsive Columns:
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Cards with Nested Admonitions:
Named closers eliminate fence-counting for complex nesting:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Named Closers
Use:::{/name}to explicitly close any container directive, eliminating the need to count colons.
Auto-Pull from Linked Pages:
Use:pull:to automatically fetch metadata from linked pages, reducing content duplication:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
The:pull:option supports:
title- Page title from frontmatterdescription- Page description from frontmattericon- Icon from frontmatterimage- Image from frontmatterdate- Page datetags- Page tags
Reference Targets
Useid:ref-namesyntax to reference pages by their frontmatteridfield instead of path. This makes links stable even if you reorganize content.
Layout Variants:
Use:layout:for different card arrangements:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Layout options:
default- Vertical card (image top, content below)horizontal- Image left, content rightportrait- Tall aspect ratio (2:3), great for app screenshots or TCG-style cardscompact- Reduced padding for dense reference lists
Portrait Cards (TCG/Phone Style):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Tabs
Create tabbed content sections for organizing related content.
Tab Set ({tab-set})
Container for tab items. Use:::{/tab-set}to close.
Syntax:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Options:
:sync:- Sync key for multiple tab-sets (same key = synchronized selection):id:- Tab set ID
Tab Item ({tab-item})
Individual tab within a tab-set.
Syntax:
1 2 3 4 5 | |
Options:
:selected:- Mark this tab as initially selected (no value needed)
Examples
Basic Tabs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Synchronized Tabs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Tabs with Nested Admonitions:
Named closers eliminate fence-counting for complex nesting:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Named Closers
Use:::{/name}to explicitly close any container directive, eliminating the need to count colons.
Dropdown
Collapsible sections for optional or advanced content.
Syntax:
1 2 3 4 5 6 7 8 9 10 | |
Options:
:open:- Open by default:true,false(default):icon:- Icon name to display next to title (e.g.,info,settings,star):badge:- Badge text (e.g., "New", "Advanced"):color:- Color variant:success,warning,danger,info,minimal:class:- Additional CSS classes
Alias:{details}works the same as{dropdown}.
Examples
Collapsed by Default:
1 2 3 4 | |
Open by Default:
1 2 3 4 5 6 | |
With Badge and Color:
1 2 3 4 5 6 7 | |
Grid (Sphinx-Design Compatibility)
Compatibility layer for Sphinx-Design grid syntax.
Syntax:
1 2 3 4 5 6 7 8 9 10 | |
Note
Prefer{cards}/{card}for new content. Grid directives convert to cards internally.
Best Practices
- Card Grids: Use for navigation, feature highlights, or content organization
- Tabs: Use for related content that doesn't need to be visible simultaneously
- Dropdowns: Use for optional or advanced content to reduce cognitive load
- Responsive Design: Use responsive column syntax (
1-2-3) for mobile-friendly layouts
Auto-Generated Cards
For section index pages, consider using{child-cards}instead of manual cards. It automatically generates cards from child sections and pages:
1 2 3 4 5 | |
See Navigation Directives for full documentation.
Related
- Navigation Directives - Auto-generated cards, breadcrumbs, siblings
- Admonitions - Callout boxes
- Formatting Directives - Badges, buttons, steps