Skip to content
Back to skills

Storybook

ASecurity

UI component development environment for building, testing, and documenting components in isolation

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 26, 2026
developmentgoreacttestingcode-reviewapidocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 26, 2026

npx -y skills add nhan03bit/ultrathink --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/nhan03bit-storybook/badge)](https://www.skillsdirectory.com/skills/nhan03bit-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
---
name: storybook
description: UI component development environment for building, testing, and documenting components in isolation
layer: domain
category: documentation
triggers:
  - "storybook"
  - "component story"
  - "CSF"
  - "visual testing"
  - "chromatic"
linksTo: [react, design-systems, testing-patterns, tailwindcss]
linkedFrom: [code-writer, code-reviewer]
riskLevel: low
memoryReadPolicy: selective
memoryWritePolicy: none
sideEffects: []
---

# Storybook

UI component development environment for building, testing, and documenting components in isolation. Enables interactive exploration via args/controls, interaction testing with play functions, and visual regression via Chromatic.

## When to Use

- Building/documenting UI components in isolation outside the app
- Running interaction tests on individual components
- Visual regression testing in CI with Chromatic
- Establishing a shared component library across teams

## Key Patterns

**CSF3** — Default export for metadata, named exports for stories:

```tsx
const meta = { component: Button, tags: ['autodocs'] } satisfies Meta<typeof Button>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Primary: Story = { args: { variant: 'primary', children: 'Click me' } };
```

**Args & Controls** — Expose props as interactive knobs via `argTypes`.

**Decorators** — Wrap with providers/theme: `decorators: [(Story) => <Provider><Story /></Provider>]`

**Play Functions** — Interaction tests using `@storybook/test`:

```tsx
play: async ({ canvasElement }) => {
  const canvas = within(canvasElement);
  await userEvent.type(canvas.getByRole('textbox'), 'hello');
  await expect(canvas.getByRole('button')).toBeEnabled();
}
```

**Autodocs** — `tags: ['autodocs']` on meta for automatic documentation pages.
**Add-ons** — `addon-a11y`, `addon-viewport`, `addon-backgrounds`, `addon-actions`.
**Chromatic** — Visual regression in CI. Exclude with `chromatic: { disableSnapshot: true }`.
**MSW** — Mock APIs per-story via `parameters.msw.handlers`.
**Composition** — Import from other Storybook instances via `refs` in `.storybook/main.ts`.

## Anti-Patterns

| Anti-Pattern | Fix |
|---|---|
| Implementation details in play functions | Query by role/label, assert visible behavior |
| One mega-story with all variants | One story per meaningful state |
| Skipping autodocs tags | Add `tags: ['autodocs']` by default |
| Hardcoded data without args | Define args and argTypes on meta |
| App-level providers imported globally | Scope decorators per-story or per-meta |

## Related Skills

`react` | `design-systems` | `testing-patterns` | `tailwindcss`

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.

Comments

Loading comments…

Newsletter

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