MDX components
Every built-in MDX component, its variants, and its usage.
Every component below is available without an import. The examples show every visual variant, so this page is also the reference for the documentation theme.
Button
Button supports the standard shadcn variant and size props. Add href to render it as a link, and use align="left", "center", or "right" to position it in the documentation column.
Tabs
Tabs supports the default and line variants. Each Tab needs a title and can have a stable value.
Install the package with npm.
The line treatment is useful for compact comparisons.
Accordion
Accordion works as a group of AccordionItem elements or as a concise, one-item disclosure. Set multiple to keep more than one item open.
Use title directly on Accordion for one disclosure, and defaultOpen to
reveal it initially.
CodeBlock
CodeBlock uses GitHub syntax highlighting and preserves every newline as a
hard code line. Use showLineNumbers when a reader may need to reference a
line.
export const theme = "github";
export const showLineNumbers = true;CodeSnippet
CodeSnippet pairs a rendered preview with its implementation. Source longer than three lines is collapsed behind a gradient; select View Code to reveal a scrollable code pane and copy it. Pass the preview as children and the source through code.
const title = "Keep examples compact"
const details = [
"Readers can reveal the implementation when they need it.",
"The open code pane keeps long examples within the page.",
"Use the copy button to take the complete snippet.",
]
export function CompactExample() {
return (
<Callout
type="tip"
title={title}
description={details.join(" ")}
/>
)
}CodeBlockGroup
CodeBlockGroup groups code blocks into tabs. It supports the same default and line tab variants as Tabs.
pnpm add @heyo-sh/heyo-docspnpm devCallout
Callout supports note, warning, info, tip, check, and danger. Each type has a matching icon and colour accent. Use title and description for a concise callout, or provide richer MDX content as children.
Badge
Badge is the shadcn primitive. Use its variants to add a compact label inline with your content. All supported variants are shown below.
It also accepts standard span attributes and render when the badge should use a different HTML element.
Rendered as a link
Properties
Properties groups Property entries into an API-style reference. A property accepts the following attributes:
| Attribute | Required | Description |
|---|---|---|
name | Yes | Name displayed in the property heading. |
type | No | A type pill, for example string, boolean, or object. |
required | No | Shows the red required pill. Omit it, or set it to false, for optional. |
className | No | Extra classes for the property or its enclosing Properties component. |
children | No | Any MDX content displayed below the property heading. |
The entries below cover the required and optional states, a property with and without a type, rich MDX content, and a property without a description.
The colors used across the documentation. At minimum, provide a primary color.
A path or URL for the favicon displayed in the browser tab.
Enables rounded surfaces throughout the documentation theme. Its default is
true.
This optional property intentionally omits type.
Use an object to map an old route to its new destination.
{ "/guides/old": "/guides/new" }Columns
Columns supports two or three columns, while Column supports card and plain variants. A href makes a card linkable.
Card column
The default card surface works well for grouped links.
Linked card
This card is a link.
Plain one
Plain two
Individual items may override the parent variant.
Card override
This column restores the card surface.
Related topics
RelatedTopics creates a compact list of nearby documentation. Each RelatedTopic takes an icon, name, and src destination.
Related topics
Images, videos, and files
Markdown images plus the Image and Video components support local paths relative to the current MDX file. They are copied into the production build, so the same source works during development and after deployment. Both components add an optional caption and the standard framed documentation treatment.
Video uses the browser's native player, enables controls by default, and accepts native video props such as loop, muted, and poster.
Use File with src or href to make a local download discoverable. Without a URL, File remains the compact item used by Tree.
Hover Card
HoverCard is the shadcn Hover Card primitive. It opens instantly by default; pass delay or closeDelay to HoverCardTrigger when a particular preview needs different timing. Its trigger can sit directly in a sentence: hover or focus this inline link to open it.
Tree
Tree contains Folder and File. Folders are open by default; set defaultOpen={false} for a collapsed branch.
app
- routes.ts
components
- theme-provider.tsx
- heyo-docs.config.ts
GitHub
GitHub only needs a GitHub URL in href; it fetches the public description, star count, and fork count in the browser. simple is the default one-card presentation. Use inset for a nested repository summary with the statistics below it.
Loading repository data…
Loading repository data…
Loading repository data…
Steps
Steps automatically numbers each Step and keeps the connector centred on the markers, even when a step contains richer content. Pass number to a step when the sequence needs an explicit number.
- 1
Install the package
Add the documentation runtime to your React Router project.
bun add @heyo-sh/heyo-docs - 2
Configure your docs
Create
heyo-docs.config.tsand point it at the directory that will hold your MDX pages. - 3
Add a page
Add an
.mdxfile to the configured content directory. Built-in components such asCallout,GitHub, andMermaidare available without imports. - 4
Start the app
Run the development server and open the generated documentation route.
bashbun run dev
Mermaid
Mermaid renders client-side with the active shadcn color tokens. SVG is the default output; use variant="ascii" for Unicode terminal-style output.
flowchart LR Content --> Build Build --> Documentation
flowchart LR Content --> Build Build --> Documentation