Skip to content

Components

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.tsx

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: [] },
};

Export components from src/index.ts to include them in the published library:

export { TaskList } from "./tasks/TaskList";