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.

ComponentUse it forExample props
CardGrid and CardLinks to related pages and next stepstitle, href, description
NoteRequirements, consequences, and warningstype, title
Step and StepItemSequential procedurestitle on StepItem
Tabs, TabsList, TabsTrigger, TabsContentAlternatives that reach the same goaldefaultValue, value
FileTree, Folder, FileDirectory and file layoutname, label, defaultOpen
MermaidFlows, sequences, and relationshipschart
EmbedA YouTube, Vimeo, or Loom walkthroughurl, 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.

tsx
<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>
PropTypePurpose
titlestring, requiredThe card heading
subtitlestringA small label above the title, such as "Guide"
descriptionstringA short line under the title
hrefstringThe page or address the card links to
iconstringA Lucide icon name, such as rocket, book, code, or settings
variantnormal, small, or imageThe card layout
externalbooleanSet 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.

tsx
<Note title="Publishing is final for readers" type="warning">
  Publishing makes the branch version live on your site. Check the preview first.
</Note>
type valueWhen to use it
note (default)General information
successA confirmation or a completed requirement
warningA change that can surprise readers or cause a problem
dangerA 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.

1

Create a branch

Open the project and create a named branch for your changes. Edits stay on that branch until you publish.

2

Edit the page

Open the page in Write mode, or in Split mode to see the rendered result beside the MDX.

3

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:

tsx
<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 StepItem directly inside its Step. Text and code blocks belong inside a StepItem.

  • Do not add a title to Step. Only StepItem takes a title.

  • 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.

tsx
<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>
PropPurpose
defaultValue on TabsThe value of the tab that opens first
value on TabsTrigger and TabsContentPairs 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.

tsx
<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>
ComponentProps
Foldername (required), label, defaultOpen, open
Filename (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.

tsx
<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.

tsx
<Embed url="https://youtu.be/dQw4w9WgXcQ" title="Setup walkthrough" />
PropPurpose
url (required)The address from the browser, such as a YouTube, Vimeo, or Loom link
titleA 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 an https address. Add alt text that describes the image.

  • Code blocks: add a language after the opening fence, such as bash or ts. Add showLineNumbers for 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 fenced math block.

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

MistakeFix
Giving the Step tag a titleWrite one Step and put the title on each StepItem
Putting text directly inside StepMove the text into a StepItem
Using a component name that is not listed hereUse one of the components in this page
Leaving alt text empty on an imageDescribe what the image shows
Pasting a real API key or token into an exampleUse 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.

Next steps