Skip to content
thebushidocollective avatar

Storybook Story Writing

Structured guide for writing Storybook stories in CSF3 format, covering meta setup, variations, and decorators.

CCM score
48 of 100
skills.sh installs
682
GitHub stars
202
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers story file organization, the default-export meta object, and typed story definitions using satisfies Meta and StoryObj
  • Includes patterns for forms, layouts, data-driven components, and responsive viewports, plus anti-patterns to avoid such as CSF2 template binding
  • Enforces CSF3 object syntax over Template.bind({}) and keeps logic out of stories in favor of args and play functions
  • Designed for React component libraries where each component gets one Component.stories.tsx file and a shared meta defaults block

Install

$ npx -y skills add thebushidocollective/han --skill storybook-story-writing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Storybook - Story Writing

Write well-structured, maintainable Storybook stories using Component Story Format 3 (CSF3) that showcase component variations and ensure consistent rendering.

Key Concepts

Component Story Format 3 (CSF3)

CSF3 is the modern Storybook format that uses object syntax for stories:

import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './Button';

const meta = {
  title: 'Components/Button',
  component: Button,
  parameters: {
    layout: 'centered',
  },
  tags: ['autodocs'],
  argTypes: {
    backgroundColor: { control: 'color' },
  },
} satisfies Meta<typeof Button>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
  args: {
    primary: true,
    label: 'Button',
  },
};

export const Secondary: Story = {
  args: {
    label: 'Button',
  },
};

Story Organization

  • One story file per component: Component.stories.tsx
  • Use descriptive story names: Primary, Secondary, Large, Disabled
  • Group related stories under a title hierarchy: Components/Forms/Input

Default Export (Meta)

The default export defines metadata for all stories:

Details

Repository
github.com/thebushidocollective/han
Categories
Frontend & UI Code, Testing & QA, Technical Documentation
First seen
Jun 3, 2026

More from thebushidocollective/han

All 14

Similar to Storybook Story Writing

More Frontend & UI Code