Back to Skills

storybook-configuration

verified

Use when setting up or configuring Storybook for a project. Covers main configuration, addons, builders, and framework-specific setup.

View on GitHub

Marketplace

han

TheBushidoCollective/han

Plugin

jutsu-storybook

Technique

Repository

TheBushidoCollective/han
60stars

jutsu/jutsu-storybook/skills/storybook-configuration/SKILL.md

Last Verified

January 24, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/jutsu/jutsu-storybook/skills/storybook-configuration/SKILL.md -a claude-code --skill storybook-configuration

Installation paths:

Claude
.claude/skills/storybook-configuration/
Powered by add-skill CLI

Instructions

# Storybook - Configuration

Configure Storybook for optimal development experience with the right addons, builders, and framework integrations.

## Key Concepts

### Main Configuration

`.storybook/main.ts` is the primary configuration file:

```typescript
import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
  addons: [
    '@storybook/addon-essentials',
    '@storybook/addon-interactions',
    '@storybook/addon-a11y',
  ],
  framework: {
    name: '@storybook/react-vite',
    options: {},
  },
  docs: {
    autodocs: 'tag',
  },
};

export default config;
```

### Preview Configuration

`.storybook/preview.ts` configures how stories are rendered:

```typescript
import type { Preview } from '@storybook/react';
import '../src/index.css';

const preview: Preview = {
  parameters: {
    controls: {
      matchers: {
        color: /(background|color)$/i,
        date: /Date$/i,
      },
    },
  },
  globalTypes: {
    theme: {
      description: 'Global theme for components',
      defaultValue: 'light',
      toolbar: {
        title: 'Theme',
        icon: 'circlehollow',
        items: ['light', 'dark'],
        dynamicTitle: true,
      },
    },
  },
};

export default preview;
```

### Addons

Addons extend Storybook functionality:

- **@storybook/addon-essentials** - Core addons bundle
- **@storybook/addon-interactions** - Interaction testing
- **@storybook/addon-a11y** - Accessibility testing
- **@storybook/addon-links** - Story navigation
- **@storybook/addon-coverage** - Code coverage
- **storybook-dark-mode** - Dark mode toggle

## Best Practices

### 1. Use TypeScript Configuration

Type-safe configuration prevents errors:

```typescript
import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
  addons: [
    '@storybook/addon-essenti

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
8903 chars