0PricingLogin
React Academy · Lesson

Setting Up Storybook in a React Project

Install Storybook, configure it for Vite or CRA, and browse the component explorer.

What Is Storybook?

Storybook is a tool for developing, documenting, and testing UI components in isolation. Each story represents a specific state of a component, viewable in the Storybook UI without running your full app.

Installation

Run the Storybook init command in your React project. It auto-detects your framework (Vite, CRA, Next.js) and creates the configuration.

# For a Vite + React project:
npx storybook@latest init

# This creates:
# .storybook/main.ts
# .storybook/preview.ts
# src/stories/ (example stories)

All lessons in this course

  1. Setting Up Storybook in a React Project
  2. Writing CSF3 Stories
  3. Args, Controls & the Actions Addon
  4. Storybook Testing & Visual Regression
← Back to React Academy