Editing and Publishing
MDX components
Components you can use in published pages, with short usage examples for each
Where components fit
Every page in Doxa is plain MDX, so you can mix Markdown with components. We use components when a plain list or paragraph would not make the page easier to scan or follow. You can add them in Write mode, in the source view, or in Split mode, as described in the content editor.
The table below lists the components that render in published pages.
| Component | Use it for | Example props |
|---|---|---|
CardGrid and Card | Links to related pages and next steps | title, href, description |
Note | Requirements, consequences, and warnings | type, title |
Step and StepItem | Sequential procedures | title on StepItem |
Tabs, TabsList, TabsTrigger, TabsContent | Alternatives that reach the same goal | defaultValue, value |
FileTree, Folder, File | Directory and file layout | name, label, defaultOpen |
Mermaid | Flows, sequences, and relationships | chart |
Embed | A YouTube, Vimeo, or Loom walkthrough | url, title |
Cards for navigation
Use cards at the start or end of a section to point readers to related pages or outside resources. Wrap the cards in a CardGrid.
<CardGrid>
<Card
subtitle="Guide"
title="Branches and previews"
description="Create a branch and review its preview before publishing."
href="/branches-publishing-history"
/>
<Card
title="Source code"
href="https://github.com/acme/widget"
external={true}
/>
</CardGrid>| Prop | Type | Purpose |
|---|---|---|
title | string, required | The card heading |
subtitle | string | A small label above the title, such as "Guide" |
description | string | A short line under the title |
href | string | The page or address the card links to |
icon | string | A Lucide icon name, such as rocket, book, code, or settings |
variant | normal, small, or image | The card layout |
external | boolean | Set to true for links outside your site |
Notes for callouts
A Note draws attention to something readers must not miss. Use it for a requirement, a consequence, or a caution. Keep notes short, and limit a page to three or four.
<Note title="Publishing is final for readers" type="warning">
Publishing makes the branch version live on your site. Check the preview first.
</Note>type value | When to use it |
|---|---|
note (default) | General information |
success | A confirmation or a completed requirement |
warning | A change that can surprise readers or cause a problem |
danger | A risk that can cause data loss or expose a secret |
Steps for procedures
Use steps when readers must follow actions in order. Write one Step for the whole procedure, and one StepItem for each action inside it. Give each StepItem a title that names the action.
Create a branch
Open the project and create a named branch for your changes. Edits stay on that branch until you publish.
Edit the page
Open the page in Write mode, or in Split mode to see the rendered result beside the MDX.
Check the preview
Open the branch preview and confirm the page reads the way you expect.
Here is the MDX source for a shorter procedure:
<Step>
<StepItem title="Create a branch">
Open the project and create a named branch for your changes.
</StepItem>
<StepItem title="Check the preview">
Open the branch preview and confirm the page reads the way you expect.
</StepItem>
</Step>Keep these rules in mind:
Put every
StepItemdirectly inside itsStep. Text and code blocks belong inside aStepItem.Do not add a
titletoStep. OnlyStepItemtakes atitle.Use steps only for actions that must happen in order. Use a bulleted list for anything else.
Leave a blank line before and after a code block inside a
StepItem.
Tabs for alternatives
Use tabs when readers can reach the same goal in more than one way, such as with different package managers or operating systems. Each TabsContent needs a TabsTrigger with the same value.
<Tabs defaultValue="npm">
<TabsList>
<TabsTrigger value="npm">npm</TabsTrigger>
<TabsTrigger value="pnpm">pnpm</TabsTrigger>
</TabsList>
<TabsContent value="npm">
```bash
npm install @acme/widget
```
</TabsContent>
<TabsContent value="pnpm">
```bash
pnpm add @acme/widget
```
</TabsContent>
</Tabs>| Prop | Purpose |
|---|---|
defaultValue on Tabs | The value of the tab that opens first |
value on TabsTrigger and TabsContent | Pairs a button with its panel |
File trees for layout
Use a FileTree when a page explains how files or folders are arranged. Use Folder for a directory and File for a file. Add a label to explain what each entry is for.
<FileTree>
<Folder name="docs" label="Documentation root" defaultOpen>
<Folder name="guides" label="Step-by-step guides">
<File name="setup.mdx" label="Setup walkthrough" />
</Folder>
<File name="index.mdx" label="Landing page" />
</Folder>
</FileTree>| Component | Props |
|---|---|
Folder | name (required), label, defaultOpen, open |
File | name (required), label |
Mermaid diagrams for flows
Use Mermaid for a flow or sequence that prose cannot show clearly. For a short list or a table, use Markdown instead.
<Mermaid
chart={`graph TD;
Writer[Write a page] --> Branch[Branch];
Branch --> Preview[Preview];
Preview --> Publish[Publish];`}
/>The chart prop takes Mermaid syntax as a string. Put it in a template string inside curly braces, as shown above.
Videos with Embed
Use Embed for a walkthrough or demo that shows a workflow better than text or screenshots. Put it on its own line near the section it illustrates.
<Embed url="https://youtu.be/dQw4w9WgXcQ" title="Setup walkthrough" />| Prop | Purpose |
|---|---|
url (required) | The address from the browser, such as a YouTube, Vimeo, or Loom link |
title | A label that screen readers announce |
YouTube, Vimeo, and Loom links play in a 16:9 frame. Any other address appears as a plain link.
Other Markdown features
These features work alongside the components:
Images: place an image on its own line, using an
/assets/path or anhttpsaddress. Add alt text that describes the image.Code blocks: add a language after the opening fence, such as
bashorts. AddshowLineNumbersfor longer code, and highlight lines with{3,5-7}.Tables and checklists: GitHub-flavored tables and task lists render as written.
Math: write inline math with
$$...$$, or use a fencedmathblock.
Code blocks above 32 KB, or pages with a very large amount of highlighted code, render as plain text without colors. Keep examples short and link to the full file instead.
Common mistakes
| Mistake | Fix |
|---|---|
Giving the Step tag a title | Write one Step and put the title on each StepItem |
Putting text directly inside Step | Move the text into a StepItem |
| Using a component name that is not listed here | Use one of the components in this page |
| Leaving alt text empty on an image | Describe what the image shows |
| Pasting a real API key or token into an example | Use a placeholder such as YOUR_API_KEY |
If a component does not show on the published site, check the MDX in Split mode. A component with a misspelled name or a missing closing tag stops the page from rendering.