UI Componentsmdxui
Renderers
MDX output format renderers
Renderers
mdxui provides multiple renderers for different output formats.
Available Renderers
| Renderer | Package | Output | Use Case |
|---|---|---|---|
| HTML | @mdxui/html | HTML string | Static sites, emails |
| JSON | @mdxui/json | JSON object | APIs, storage |
| Markdown | @mdxui/markdown | Markdown string | Export, migration |
| shadcn | @mdxui/shadcn | React elements | React apps |
Choosing a Renderer
Static Output
For static HTML pages, emails, or server rendering:
API Responses
For JSON APIs or structured data:
React Applications
For React applications with styled components:
Content Export
For converting MDX back to Markdown:
Common API
All renderers share a common interface:
Multi-Format Output
Render to multiple formats at once:
Custom Renderers
Create custom renderers:
Feature Comparison
| Feature | HTML | JSON | Markdown | shadcn |
|---|---|---|---|---|
| Syntax Highlighting | ✓ | - | ✓ | ✓ |
| Custom Components | ✓ | ✓ | - | ✓ |
| CSS Classes | ✓ | - | - | ✓ |
| Table of Contents | ✓ | ✓ | - | ✓ |
| Round-trip | - | ✓ | ✓ | - |
| Streaming | ✓ | - | - | ✓ |