UI Components
UI Components
Component templates, composition, and rendering packages for MDX applications
The UI Components layer provides component templates and rendering packages for building interfaces from MDX documents.
Templates (Components)
Templates are JSX components that know how to render to multiple formats and extract data back:
Composition
Templates compose together like React components:
Composition enables:
- Reusability - Use
Heroin multiple templates - Nesting - Deep component trees
- Overrides - Customize rendering per-component
Encapsulation
Each component encapsulates its own rendering logic:
Components encapsulate:
- Schema - The shape of data they accept
- Layout - How they render to each format
- Extraction - How they parse content back to data
mdxui Package
The presentation layer adds styling on top of semantic output:
- @mdxui/shadcn - shadcn/ui styled components
- @mdxui/tailwind - Tailwind CSS styling
- @mdxui/email - Email-optimized HTML
- @mdxui/slack - Slack Block Kit
- @mdxui/fumadocs - Documentation sites
Component Specifications
Each component is defined with:
- Props - Input properties with types
- Parts - CSS
::part()slots for styling - CSS Variables - Themeable design tokens
- Semantic HTML - Accessibility-first structure
Layout Components
| Component | Description |
|---|---|
| Site | Website wrapper with header, nav, footer |
| App | Root application with providers |
| Page | Individual page container |
| Section | Content section with heading |
| View | Generic view container |
| Layout | Flexible layout system |
Marketing Components
| Component | Description |
|---|---|
| Hero | Hero section with CTA |
| LandingPage | Complete landing page |
| Features | Feature grid |
| Pricing | Pricing table |
| CTA | Call-to-action section |
| Testimonials | Customer testimonials |
| Team | Team member grid |
| FAQ | FAQ accordion |
Content Components
| Component | Description |
|---|---|
| Blog | Blog listing page |
| BlogPost | Individual blog post |
| Article | Long-form article |
| Docs | Documentation page |
| API | API documentation |
Data Components
| Component | Description |
|---|---|
| Dashboard | Dashboard layout |
| Directory | Directory listing |
| Card | Content card |
| Table | Data table |
| ListView | List view |
| DetailView | Detail page |
| FormView | Form layout |
Navigation Components
| Component | Description |
|---|---|
| Header | Page header |
| Footer | Page footer |
| Nav | Navigation menu |
| Sidebar | Sidebar navigation |
| Modal | Modal dialog |
Output Formats
Components can render to multiple formats:
- html - React/HTML output
- markdown - Plain markdown
- json - JSON-LD structured data
- svg - Vector graphics
- png - Raster images
Styling with Parts
Use CSS ::part() selectors for styling:
CSS Variables
Each component exposes themeable CSS variables: