This project uses Storybook for component development and documentation.
To run Storybook locally:
bun run storybookTo build Storybook for production:
bun run build-storybookStories are organized by feature area:
- Common - Shared UI components (buttons, cards, displays)
- Image - Image generation and editing components
- Audio - Audio playback and recording components
- MEMU - Workflow and chat components
- Video - Video effects and processing components
- Controls - Dynamically interact with component props
- Actions - Log actions as users interact with components
- Viewport - Test responsive designs
- A11y - Accessibility testing
- Docs - Auto-generated documentation
Storybook is configured with dark and light themes that match the app design. The dark theme is set as default.
- Theme Provider - Provides DaisyUI theme switching
- Clerk Provider - Mocks authentication for testing
- MpContext Provider - Provides token balance context
Basic story structure:
import type { Meta, StoryObj } from '@storybook/react'
import { YourComponent } from '@/components/YourComponent'
const meta = {
title: 'Category/YourComponent',
component: YourComponent,
parameters: {
layout: 'centered', // or 'fullscreen', 'padded'
},
tags: ['autodocs'],
argTypes: {
// Define controls for props
},
} satisfies Meta<typeof YourComponent>
export default meta
type Story = StoryObj<typeof meta>
export const Default: Story = {
args: {
// Default props
},
}- Organize by Feature - Group related components together
- Document Props - Use argTypes to document all props
- Show States - Create stories for loading, error, and empty states
- Test Responsiveness - Add mobile/tablet viewport stories
- Include Actions - Log user interactions for interactive components
- Use the controls panel to dynamically change props
- Test accessibility with the a11y addon
- Check responsive design with viewport addon
- Document complex components with MDX stories