Storybook
Interactive component playground for mdxui components
Storybook
Explore and interact with mdxui components in our comprehensive Storybook playground. All components are documented with live examples, props, variants, and accessibility features.
What is Storybook?
Storybook is an interactive development environment for UI components. It provides:
- Live Component Preview - See components in isolation with real-time updates
- Props Explorer - Interact with component props to see behavior changes
- Variant Showcase - View all visual variants and states
- Documentation - Detailed usage examples and API documentation
- Accessibility Testing - Built-in accessibility checks and keyboard navigation
- Responsive Testing - Test components at different viewport sizes
Quick Start
Local Development
Start Storybook on your local machine:
pnpm storybookOpens at localhost:6006
Production
Visit the live Storybook deployment:
Component Organization
mdxui components are organized into four main categories:
Primitives
Core UI building blocks used by all templates. Over 60+ components including:
- Form controls (Input, Select, Checkbox, etc.)
- Layout primitives (Card, Sidebar, Dashboard Shell)
- Navigation (Navigation Menu, Breadcrumb, Tabs)
- Overlays (Dialog, Drawer, Popover, Tooltip)
- Data display (Table, Chart, Calendar, Avatar)
Widgets
Complex, feature-rich components built on primitives:
- ChatBox - AI chat interface
- Editor - Code and text editing
- SearchBox - Advanced search
- Onboarding - Multi-step wizards
- Command Palette - Quick actions
Site Components (Beacon)
Marketing and content components implementing the SiteComponents interface:
- Hero sections
- Feature showcases
- Pricing tables
- Testimonials
- CTA sections
- Page templates
App Components (Cockpit)
Dashboard and authenticated app components implementing the AppComponents interface:
- Developer Dashboard
- API Key Manager
- Team Manager
- Settings Pages
- Team Switcher
Embedded Storybook (Coming Soon)
We're working on embedding Storybook directly in the docs for seamless exploration:
<StorybookEmbed story="primitives-button--primary" />For now, use the local development server or production deployment to explore components interactively.
Using Components
All Storybook examples show how to import and use components:
Example: Button Component
import { Button } from '@mdxui/primitives'
export function MyComponent() {
return (
<Button variant="default" size="md">
Click me
</Button>
)
}Example: Card Component
import { Card, CardHeader, CardTitle, CardContent } from '@mdxui/primitives'
export function MyCard() {
return (
<Card>
<CardHeader>
<CardTitle>Card Title</CardTitle>
</CardHeader>
<CardContent>
Card content goes here
</CardContent>
</Card>
)
}Learning Paths
New to mdxui?
- Start with Primitives to understand basic components
- Review Patterns for common compositions
- Browse the Component Catalog for specific needs
- Explore live examples in Storybook
Building a Site?
- Review Site Components in the catalog
- See Beacon package documentation
- Check Storybook for Hero, Features, and Pricing components
Building an App?
- Review App Components in the catalog
- See Cockpit package documentation
- Check Storybook for Dashboard, Sidebar, and Settings components
Features
Interactive Props
Every component in Storybook includes an interactive controls panel where you can:
- Modify props in real-time
- See component behavior change instantly
- Copy code examples with your selected props
- Test edge cases and validation
Visual Variants
Each component showcases all available variants:
- Button: default, destructive, outline, secondary, ghost, link
- Alert: default, destructive, success, warning
- Card: default, elevated, bordered, interactive
Accessibility
All components are tested for:
- ARIA labels and roles
- Keyboard navigation
- Focus management
- Screen reader support
- Color contrast ratios
Responsive Design
Use Storybook's viewport toolbar to test components at:
- Mobile (375px)
- Tablet (768px)
- Desktop (1280px)
- Wide (1920px)
Contributing
Found a bug or want to add a component variant?
- Component source is in
packages/directory - Stories are in
*.stories.tsxfiles - Run
pnpm storybookto test changes - Submit a PR with your improvements
Documentation Structure
- Component Catalog - Complete component listing
- Primitives - Core UI building blocks
- Patterns - Common UI patterns and compositions
Next Steps
- Browse the Component Catalog
- Explore UI Primitives
- Learn UI Patterns
- Visit localhost:6006 to interact with components