Components
File conventions
Section titled “File conventions”Each component lives in a feature directory under src/ with its source, story, and tests co-located:
src/tasks/├── TaskList.tsx├── TaskList.story.tsx└── TaskList.test.tsxWriting stories
Section titled “Writing stories”Stories use the .story.tsx extension and follow the Component Story Format:
import type { Meta, StoryObj } from "@storybook/react";import { TaskList } from "./TaskList";
const meta: Meta<typeof TaskList> = { component: TaskList,};
export default meta;type Story = StoryObj<typeof TaskList>;
export const Default: Story = { args: { tasks: [] },};Exporting
Section titled “Exporting”Export components from src/index.ts to include them in the published library:
export { TaskList } from "./tasks/TaskList";