
storybook-component-documentation
Use when creating or improving component documentation in Storybook. Helps generate comprehensive docs using MDX, autodocs, and JSDoc comments.
- Installs
- 167
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/thebushidocollective/han --skill storybook-component-documentation- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads storybook-component-documentation automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Storybook - Component Documentation
Create comprehensive, auto-generated component documentation using Storybook's autodocs feature, MDX pages, and JSDoc comments.
Key Concepts
Autodocs
Automatically generate documentation pages from stories:
const meta = {
title: 'Components/Button',
component: Button,
tags: ['autodocs'], // Enable auto-documentation
parameters: {
docs: {
description: {
component: 'A versatile button component with multiple variants and sizes.',
},
},
},
} satisfies Meta<typeof Button>;
MDX Documentation
Create custom documentation pages with full control:
import { Meta, Canvas, Story, Controls } from '@storybook/blocks';
import * as ButtonStories from './Button.stories';
<Meta of={ButtonStories} />
# Button Component
A versatile button component for user interactions.
## Usage
<Canvas of={ButtonStories.Primary} />
## Props
<Controls of={ButtonStories.Primary} />
JSDoc Comments
Document component props for auto-extraction:
interface ButtonProps {
/**
* The button label text
*/
label: string;
/**
* Is this the principal call to action?
* @default false
*/
primary?: boolean;
/**
* Button size variant
* @default 'medium'
*/
size?: 'small' | 'medium' | 'large';
}
Best Practices
1. Enable Autodocs
Add the autodocs tag to generate documentation automatically:
const meta = {
component: Button,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'Button component with primary and secondary variants.',
},
},
},
} satisfies Meta<typeof Button>;
2. Document Component Descriptions
Provide clear, concise component descriptions:
const meta = {
component: Tooltip,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: `
Tooltip displays helpful information when users hover over an element.
Supports multiple placements and can be triggered by hover, click, or focus.
## Features
- Multiple placement options
- Customizable delay
- Accessible (ARIA compliant)
- Keyboard navigation support
`.trim(),
},
},
},
} satisfies Meta<typeof Tooltip>;
3. Document Story Variations
Add descriptions to individual stories:
export const WithIcon: Story = {
args: {
label: 'Download',
icon: 'download',
},
parameters: {
docs: {
description: {
story: 'Buttons can include icons to enhance visual communication.',
},
},
},
};
export const Loading: Story = {
args: {
loading: true,
label: 'Processing...',
},
parameters: {
docs: {
description: {
story: 'Loading state disables interaction and shows a spinner.',
},
},
},
};
4. Use JSDoc for Type Documentation
Document props with JSDoc for rich documentation:
interface CardProps {
/**
* Card title displayed at the top
*/
title: string;
/**
* Optional subtitle below the title
*/
subtitle?: string;
/**
* Card variant affecting visual style
* @default 'default'
*/
variant?: 'default' | 'outlined' | 'elevated';
/**
* Card content
*/
children: React.ReactNode;
/**
* Called when card is clicked
* @param event - The click event
*/
onClick?: (event: React.MouseEvent) => void;
/**
* Elevation level (shadow depth)
* @minimum 0
* @maximum 5
* @default 1
*/
elevation?: number;
}
5. Create Usage Examples
Show realistic usage examples in MDX:
import { Meta, Canvas, Story } from '@storybook/blocks';
import * as FormStories from './Form.stories';
<Meta of={FormStories} />
# Form Component
## Basic Usage
<Canvas of={FormStories.Default} />
## With Validation
<Canvas of={FormStories.WithValidation} />
```tsx
import { Form } from './Form';
function MyForm() {
return (
<Form
onSubmit={(data) => console.log(data)}
validationSchema={schema}
>
<Input name="email" label="Email" />
<Button type="submit">Submit</Button>
</Form>
);
}
## Common Patterns
### Component Overview Page
```mdx
import { Meta, Canvas, Controls } from '@storybook/blocks';
import * as ButtonStories from './Button.stories';
<Meta of={ButtonStories} />
# Button
Buttons trigger actions and events throughout the application.
## Variants
### Primary
Use primary buttons for the main call-to-action.
<Canvas of={ButtonStories.Primary} />
### Secondary
Use secondary buttons for less important actions.
<Canvas of={ButtonStories.Secondary} />
## Props
<Controls of={ButtonStories.Primary} />
## Accessibility
- Keyboard accessible (Enter/Space to activate)
- Screen reader friendly
- Focus visible indicator
- Proper ARIA labels
## Best Practices
- Use clear, action-oriented labels
- Provide sufficient click target size (min 44×44px)
- Don't use more than one primary button per section
- Include loading states for async actions
API Documentation
const meta = {
component: DataGrid,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'Advanced data grid with sorting, filtering, and pagination.',
},
},
},
argTypes: {
data: {
description: 'Array of data objects to display',
table: {
type: { summary: 'Array<Record<string, any>>' },
},
},
columns: {
description: 'Column configuration',
table: {
type: { summary: 'ColumnDef[]' },
},
},
onRowClick: {
description: 'Callback fired when a row is clicked',
table: {
type: { summary: '(row: any, index: number) => void' },
},
},
},
} satisfies Meta<typeof DataGrid>;
Migration Guides
import { Meta } from '@storybook/blocks';
<Meta title="Guides/Migration/v2 to v3" />
# Migration Guide: v2 → v3
## Breaking Changes
### Button Component
**Before (v2):**
```tsx
<Button type="primary">Click me</Button>
After (v3):
<Button variant="primary">Click me</Button>
The type prop has been renamed to variant for consistency.
Input Component
Before (v2):
<Input error="Invalid email" />
After (v3):
<Input error={{ message: "Invalid email" }} />
Error handling now uses an object to support additional metadata.
New Features
Icon Support
Buttons now support icons:
<Button variant="primary" icon="check">
Save
</Button>
### Design Tokens
Document design tokens and theming:
```mdx
import { Meta, ColorPalette, ColorItem, Typeset } from '@storybook/blocks';
<Meta title="Design System/Colors" />
# Color Palette
## Primary Colors
<ColorPalette>
<ColorItem
title="Primary"
subtitle="Main brand color"
colors={{ Primary: '#007bff' }}
/>
<ColorItem
title="Secondary"
subtitle="Supporting color"
colors={{ Secondary: '#6c757d' }}
/>
</ColorPalette>
## Typography
<Typeset
fontSizes={[12, 14, 16, 20, 24, 32, 40, 48]}
fontWeight={400}
sampleText="The quick brown fox jumps over the lazy dog"
/>
Advanced Patterns
Inline Stories in MDX
import { Meta, Story } from '@storybook/blocks';
import { Button } from './Button';
<Meta title="Components/Button/Examples" component={Button} />
# Button Examples
## Inline Story
<Story name="Custom">
{() => {
const [count, setCount] = React.useState(0);
return (
<Button onClick={() => setCount(count + 1)}>
Clicked {count} times
</Button>
);
}}
</Story>
Code Snippets
import { Source } from '@storybook/blocks';
<Meta title="Guides/Setup" />
# Installation
Install the component library:
<Source
language="bash"
code={`
npm install @company/ui-components
# or
yarn add @company/ui-components
`}
/>
Then import components:
<Source
language="tsx"
code={`
import { Button, Input, Form } from '@company/ui-components';
function App() {
return (
<Form>
<Input label="Email" />
<Button>Submit</Button>
</Form>
);
}
`}
/>
Anti-Patterns
❌ Don't Skip Component Descriptions
// Bad
const meta = {
component: Button,
tags: ['autodocs'],
} satisfies Meta<typeof Button>;
// Good
const meta = {
component: Button,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'Primary UI component for user actions.',
},
},
},
} satisfies Meta<typeof Button>;
❌ Don't Use Generic JSDoc Comments
// Bad
interface ButtonProps {
/** The label */
label: string;
/** The size */
size?: string;
}
// Good
interface ButtonProps {
/** Text displayed on the button */
label: string;
/**
* Visual size of the button
* @default 'medium'
*/
size?: 'small' | 'medium' | 'large';
}
❌ Don't Forget Story Descriptions
// Bad
export const Disabled: Story = {
args: { disabled: true },
};
// Good
export const Disabled: Story = {
args: { disabled: true },
parameters: {
docs: {
description: {
story: 'Disabled state prevents user interaction and dims the button visually.',
},
},
},
};
Related Skills
- storybook-story-writing: Creating well-structured stories
- storybook-args-controls: Configuring interactive controls for props
- storybook-configuration: Setting up Storybook with proper documentation addons
FAQ
What does the storybook-component-documentation skill do?
Use when creating or improving component documentation in Storybook. Helps generate comprehensive docs using MDX, autodocs, and JSDoc comments.
How do I install storybook-component-documentation?
Run npx skills add https://github.com/thebushidocollective/han --skill storybook-component-documentation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/storybook-component-documentation/ (personal) or .claude/skills/storybook-component-documentation/ (project).
Which AI agents can use storybook-component-documentation?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is storybook-component-documentation safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains storybook-component-documentation?
It is published by thebushidocollective/han in thebushidocollective/han. It has 167 recorded installs.
More from thebushidocollective/han
android-jetpack-compose
thebushidocollective/han
Use when building Android UIs with Jetpack Compose, managing state with remember/mutableStateOf, or implementing declarative UI patterns.
fastapi-async-patterns
thebushidocollective/han
Use when FastAPI async patterns for building high-performance APIs. Use when handling concurrent requests and async operations.
atomic-design-fundamentals
thebushidocollective/han
Use when applying Atomic Design methodology to organize UI components into quarks, atoms, molecules, organisms, templates, and pages. Core principles and hierarchy.
storybook-story-writing
thebushidocollective/han
Use when creating or modifying Storybook stories for components. Ensures stories follow CSF3 format, properly showcase component variations, and build successfully.
solid-principles
thebushidocollective/han
Use during implementation when designing modules, functions, and components requiring SOLID principles for maintainable, flexible architecture.
docker-compose-production
thebushidocollective/han
Use when deploying Docker Compose applications to production including security hardening, resource management, health checks, logging, monitoring, and high-availability patterns.
Popular docs & writing skills
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
lark-markdown
open.feishu.cn
飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。
writing-for-agents
mattpocock/skills
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
slideshow
heygen-com/hyperframes
Build a HyperFrames slideshow to present live - slides, fragment reveals, branching hotspots and presenter mode with speaker notes, served by hyperframes present - or turn an existing page into one. Use when the person wants a deck or presentation rather than a rendered video.
writing-beats
mattpocock/skills
Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.
writing-shape
mattpocock/skills
Writing, exploit: shape raw material into an article, paragraph by paragraph.