storybook-component

Creates Storybook 10 stories with CSF3 meta, decorators, args, and play functions for React components.

11|2|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/recca0120/code-quest --skill storybook-component-recca0120
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: storybook-component
Source: https://github.com/recca0120/code-quest/tree/main/.claude/skills/storybook-component
Command: npx skills add https://github.com/recca0120/code-quest --skill storybook-component-recca0120

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Storybook component development removes uncertainty about how React UI components look and behave by making their states and interactions explicit and reviewable during development.

Core Features & Use Cases

  • Component-first workflow: Define a component and its co-located .stories.tsx story to keep documentation and implementation in sync.
  • Stateful story coverage: Create one story per meaningful UI state (default, loading, error, disabled, edge cases) to improve completeness.
  • Interaction testing with play functions: Verify user interactions (clicks, typing, hover) inside Storybook to confirm behavioral expectations without duplicating render tests.
  • Reusable Story templates: Use CSF3 meta, decorators, and shared args to standardize wrappers, providers, and layout context.
  • Organization and governance: Apply naming conventions, a checklist for new components, and a test strategy split between Storybook (UI) and vitest (logic).

Quick Start

Create MyComponent.tsx and a co-located MyComponent.stories.tsx that exports a Default story with appropriate meta, then add additional named stories and any play interactions for the behaviors you want to verify.

Frequently Asked Questions about storybook-component

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to document React component states in Storybook?

Document React component states in Storybook by creating a co-located `.stories.tsx` file using CSF3 meta configuration. Define one named story per meaningful UI state, such as default, loading, error, or disabled, to keep visual documentation and implementation in sync.

How do I write interaction tests for Storybook stories using play functions?

Write interaction tests for Storybook stories by adding optional play functions to your CSF3 story exports. Use Storybook test utilities inside the play function to query elements by accessibility roles and assert expected behaviors like clicks or typing without duplicating render tests.

How do I configure CSF3 meta and decorators for shared React component args?

Configure CSF3 meta and decorators by exporting a meta object with component metadata, then apply decorators to standardize wrapper context. Define shared args within the meta or individual stories to inject reusable properties and layout providers across your React component variations.

Can I use Storybook for both UI state documentation and logic testing?

Storybook handles UI state documentation and interaction testing through play functions, verifying component behaviors visually. For separate logic testing, the recommended strategy splits UI verification to Storybook and underlying logic testing to vitest, ensuring complete component coverage without duplication.

When should I create separate stories for React component edge cases?

Create separate stories for React component edge cases to improve stateful coverage completeness. Defining one story per meaningful UI state, including loading, error, and disabled variations, makes component behavior explicit and reviewable during development, reducing uncertainty about how components look and behave.