Skip to content
Back to skills

Storybook

ASecurity

- Use `@storybook/nextjs` framework for automatic Next.js config support - Configure `main.ts`: `framework: { name: '@storybook/nextjs' }` - Stories location: `stories: ['../src/**/*.stories.@(ts|tsx)']`

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
data-aireactnextjstestingdocumentation

Works with

  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add ByeongminLee/nextjs-claude-code --skill storybook --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Storybook?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Storybook
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/byeongminlee-storybook/badge)](https://www.skillsdirectory.com/skills/byeongminlee-storybook)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Storybook Best Practices

## Setup (Next.js)
- Use `@storybook/nextjs` framework for automatic Next.js config support
- Configure `main.ts`: `framework: { name: '@storybook/nextjs' }`
- Stories location: `stories: ['../src/**/*.stories.@(ts|tsx)']`

## Story Structure
```tsx
// Button.stories.tsx
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './Button';

const meta = {
  component: Button,
  tags: ['autodocs'],           // auto-generate docs page
  argTypes: {
    variant: { control: 'select', options: ['primary', 'secondary'] },
  },
} satisfies Meta<typeof Button>;
export default meta;

type Story = StoryObj<typeof meta>;

export const Primary: Story = { args: { variant: 'primary', children: 'Click' } };
export const Loading: Story = { args: { loading: true } };
```

## Patterns
- **One component per story file**: `ComponentName.stories.tsx` next to component
- **Args over hardcoded props**: Use `args` for all configurable props
- **Play functions**: Simulate user interactions for interaction testing
- **Decorators**: Wrap stories with providers (theme, router, query client)
- **CSF3 format**: Use `satisfies Meta<typeof Component>` for type safety

## Organization
- Group by domain: `sidebar: { order: ['Atoms', 'Molecules', 'Organisms', 'Pages'] }`
- Use `tags: ['autodocs']` for automatic documentation
- Add `parameters.design` for Figma link integration (with `storybook-addon-designs`)

## Testing Integration
- Visual regression: Chromatic or `@storybook/test-runner`
- Accessibility: `@storybook/addon-a11y` for per-story a11y checks
- Interaction tests: `play` function + `@storybook/testing-library`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data-ai →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.