Skip to content
Margin

Choose MDX components

Find a built-in component by its purpose and open its usage reference.

Use built-in components directly in an MDX page without importing them. Choose a component by the content it needs to present, then copy its source example.

The linked Mintlify syntax references provide longer examples. Margin’s supported behavior is described here; a tag being supported does not mean every Mintlify prop or layout behavior is supported.

Choose callouts and layouts

Use a callout for information that changes how the reader completes a task. Use cards for destinations and columns for side-by-side content.

ComponentChoose it forShort source example
CalloutA general callout with an explicit type<Callout type="info">Changes apply on the next build.</Callout>
NoteA blue informational note<Note>The page must be in navigation.</Note>
InfoNeutral supporting information<Info>The preview uses this branch.</Info>
TipAn optional recommendation<Tip>Reuse this block as a snippet.</Tip>
WarningA caution before continuing<Warning>Check the target branch before pushing.</Warning>
CheckA successful result<Check>The build completed.</Check>
DangerAn error or destructive-action warning<Danger>Deleting this file removes its content.</Danger>
CardA linked or unlinked content card<Card title="Source" href="https://github.com/maniculehq/margin">Read the framework code.</Card>
CardGroupA responsive card grid<CardGroup cols="2"><Card title="Hosted">Publish on Manicule.</Card><Card title="Self-hosted">Run Margin yourself.</Card></CardGroup>
ColumnsA responsive grid for content other than cards too<Columns cols="2"><div>Before</div><div>After</div></Columns>
ImageAn image with click-to-zoom<Image src="/images/preview.png" alt="Documentation preview" />
FrameMedia with a caption<Frame caption="Documentation preview"><Image src="/images/preview.png" alt="Documentation preview" /></Frame>
PanelCompatibility with authored panel content<Panel>Related deployment information.</Panel>
TileA preview above a title and description<Tile title="Preview" description="Open the source repository." href="https://github.com/maniculehq/margin">Margin</Tile>
PreviewButtonA link styled as a small button<PreviewButton href="https://github.com/maniculehq/margin">Open source</PreviewButton>

CardGroup and Columns use the same grid. cols accepts 1 through 4 and defaults to 2. Panel currently renders its children inline; it does not replace the table-of-contents column. For the image examples, add your own image at images/preview.png relative to the docs root.

Organize procedures and alternatives

Use Steps when the reader must perform actions in sequence. Use Tabs for alternative instructions and CodeGroup when the alternatives are code samples. Keep optional detail in an accordion rather than hiding a required action.

ComponentChoose it forShort source example
Steps and StepA numbered procedure and each action within it<Steps><Step title="Publish">Push the documentation change.</Step></Steps>
Tabs and TabLabeled alternative content panels<Tabs><Tab title="Hosted">Connect the repository.</Tab><Tab title="Self-hosted">Deploy Margin.</Tab></Tabs>
AccordionOne collapsible block, including standalone use<Accordion title="Troubleshooting">Check the build diagnostics.</Accordion>
AccordionGroupRelated collapsible blocks<AccordionGroup><Accordion title="Build">Check diagnostics.</Accordion><Accordion title="Links">Check destinations.</Accordion></AccordionGroup>
ExpandableCollapsible nested attributes<Expandable title="child attributes">Describe nested fields here.</Expandable>

CodeGroup takes fenced code blocks. Give every fence a title so the tab label identifies the sample:

<CodeGroup>

```json title="docs.json"
{"name": "Acme"}
```

```md title="index.mdx"
# Welcome
```

</CodeGroup>

Read the code-group syntax reference for larger examples.

View creates selectable content variations from consecutive sibling tags. Write the variations next to each other without an authored ViewGroup wrapper:

<View title="Hosted">Connect the repository on Manicule.</View>
<View title="Self-hosted">Deploy the Margin application.</View>

See the view syntax reference. Unlike numbered steps, views represent alternatives rather than actions to complete in order.

Describe API contracts

Use ParamField for an input and ResponseField for an output. These components describe fields; they do not send requests or enforce validation.

ComponentChoose it forShort source example
ParamFieldAn input name, location, type, and description<ParamField query="limit" type="integer">Number of results requested.</ParamField>
ResponseFieldAn output field and its description<ResponseField name="items" type="array">Returned results.</ResponseField>

The names and data below illustrate a hypothetical API, not a Margin endpoint. RequestExample and ResponseExample currently render inline as code groups, not in a separate right-hand example column:

<RequestExample>

```json title="Request body"
{"name": "Example"}
```

</RequestExample>

<ResponseExample>

```json title="Response body"
{"id": "example"}
```

</ResponseExample>

The example syntax reference has larger request and response samples. Use Expandable inside a field description when the field contains child attributes.

Add diagrams and annotations

Use diagrams for relationships and trees for file structure. Keep status labels and definitions near the content they qualify.

ComponentChoose it forShort source example
MermaidA diagram rendered in the browser<Mermaid chart="graph LR; Source-->Build;" />
IconAn inline icon<Icon icon="terminal" />
BadgeA neutral status label<Badge>Beta</Badge>
TooltipA definition shown on hover or focus<Tooltip tip="The branch used for publishing">Deploy branch</Tooltip>
UpdateA dated changelog entry<Update label="2026-01-01" description="Documentation update">Added a setup guide.</Update>
PromptPrompt text with a copy action<Prompt description="Review a page">Find broken links in this page.</Prompt>
TreeA file hierarchy<Tree><Tree.Folder name="docs"><Tree.File name="index.mdx" /></Tree.Folder></Tree>
FileTreeThe same file hierarchy using its alias<FileTree><FileTree.Folder name="docs"><FileTree.File name="index.mdx" /></FileTree.Folder></FileTree>
ColorClick-to-copy color swatches<Color><Color.Row title="Brand"><Color.Item name="Primary" value="#2563EB" /></Color.Row></Color>
GitHubA public repository card<GitHub.Repo repo="maniculehq/margin" />

GitHub is used through GitHub.Repo. The card fetches repository details in the visitor’s browser and falls back to a repository link when details are unavailable. Prompt displays its description and copy control; the prompt body is not displayed as page prose.

The supported built-in member tags are Tree.File, Tree.Folder, FileTree.File, FileTree.Folder, Color.Item, Color.Row, and GitHub.Repo. Other dotted names are not accepted as built-in members.

Target readers and reuse content

Use audience wrappers when human instructions and agent instructions need to differ. Content outside an audience wrapper remains available to both readers.

ComponentChoose it forShort source example
VisibilityExplicit audience selection<Visibility for="agents">Read the Markdown rendition.</Visibility>
AgentAgent-only content, as an alias<Agent>Read the Markdown rendition.</Agent>
HumanHuman-only content, as an alias<Human>Use the navigation sidebar.</Human>
SnippetIncluding reusable content at ingest<Snippet file="snippets/shared-note.mdx" />

Visibility recognizes for="agents" and for="humans". Agent content is absent from the human HTML rendition; human content is omitted from agent Markdown. An omitted or unrecognized for value addresses both audiences. Audience wrappers select presentation, not access permissions.

Before using the snippet example, create snippets/shared-note.mdx under the docs root with the content to reuse. Margin expands the snippet into the page during ingest.

Handle unknown components

An unknown capitalized component is removed as a wrapper during ingest. Its children remain, and the build records a component_unknown warning rather than failing for that unknown name. The component’s layout and behavior do not survive.

For example, an unsupported wrapper around a sentence leaves the sentence as ordinary content:

<CustomBox>Check the build diagnostics.</CustomBox>

The result is Check the build diagnostics. without a box. An unknown self-closing component has no children to preserve. Replace unknown tags with the closest built-in component, and check the rendered page as well as the build diagnostics. Misspelled or unsupported member tags follow the same warning-and-unwrapping behavior.