| name | storybook |
| description | Storybook UI component development and testing. Use for component testing. |
Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. It enables you to develop UI components without running your entire app (and logic/APIs).
When to Use
- Component Libraries: Building a Design System.
- Visual Testing: Visualizing all states of a component (Loading, Error, Empty).
- Documentation: Auto-generating docs for your team.
Quick Start
npx storybook@latest init
npm run storybook
Snippet:
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "./Button";
const meta: Meta<typeof Button> = {
component: Button,
};
export default meta;
type Story = StoryObj<typeof >;
: = {
: {
: ,
: ,
},
};