> **Version 11 (RC)** — **React** / **TypeScript**
> Also available:
- `?codeOnly=true` for code snippets only
- other versions: Version 10.6 (latest) (`/docs/ai/skills/component-docs.md`), Version 9 (`/docs/9/ai/skills/component-docs.md`), Version 8 (`/docs/8/ai/skills/component-docs.md`)

# Component docs

The `/component-docs` skill lets your agent look up your components, with their props and usage examples, so it will use them correctly and can answer questions about them. It needs a [components manifest](https://storybook.js.org/docs/11/ai/reference/manifests.md), which your framework doesn't generate yet. See [framework support](https://storybook.js.org/docs/11/ai/reference/manifests.md#framework-support).

The `/component-docs` skill lets your agent look up the components in your Storybook, with their props and usage examples. Your agent will then use the components you have instead of building new ones, use only the props and attributes they support, and answer questions about how to use them.

## When your agent uses it

The skill is step 1 of the [Storybook section in `AGENTS.md`](https://storybook.js.org/docs/11/ai/agents-md.md). With that section, your agent uses it before it edits any file for a UI change. Its description also makes your agent use it when you ask about a component's props, API, or usage. For example:

| Task                    | Example prompt                                                         | What the agent does                                                                                                                     |
| ----------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Use your components     | "Build a new settings page"                                            | Looks for existing components that can be reused for the new page as step 1 of the [Storybook section in `AGENTS.md`](https://storybook.js.org/docs/11/ai/agents-md.md) |
| Choose a component      | "Should I use `Button` or `IconButton` for a toolbar's close control?" | Compares the descriptions, props, and examples of both, then recommends one and says why                                                |
| Find the right props    | "Which props make `Dialog` more accessible?"                           | Lists only the documented props that apply, such as labels and focus behavior, and says if none do the job                              |
| Answer a usage question | "Which props does `Card` take?"                                        | Shows the props, their types, and example stories                                                                                       |

## What the agent reads

The agent reads your components' documentation from your Storybook, not from source files or `node_modules`:

- A list of every component and docs page, with a summary of each
- For each component: its description, its props with their types, and the code of its first stories
- The code of any other story, when the first stories don't show the usage it needs

This information comes from the [components manifest](https://storybook.js.org/docs/11/ai/reference/manifests.md). The agent reads source files only when your Storybook has no documentation for what it needs.

## Components from other Storybooks

If your Storybook uses [composition](https://storybook.js.org/docs/11/sharing/storybook-composition.md), the agent also sees the components of each composed Storybook that has a components manifest. For example, an app's Storybook can compose your design system's published Storybook. The agent then finds components in both, and can tell you which app components duplicate a design system component.

## Get better results

The agent can only answer from what your Storybook documents. Good documentation helps it choose and use the right component:

- **Component summaries and descriptions** that say when to use the component, and when to use another one instead. These help the agent choose between similar components, such as `Button` and `IconButton`.
- **Prop descriptions**, especially for accessibility props such as `aria-label` or `closeLabel`.
- **Stories that show real usage**, such as an icon-only button with its accessible label.

See the [best practices](https://storybook.js.org/docs/11/ai/best-practices.md) for more guidance on documenting your components.

## Requirements

- A [components manifest](https://storybook.js.org/docs/11/ai/reference/manifests.md). See [framework support](https://storybook.js.org/docs/11/ai/reference/manifests.md#framework-support).

**More AI resources**

- [Connect your agent](https://storybook.js.org/docs/11/ai/connect.md)
- [The AGENTS.md section](https://storybook.js.org/docs/11/ai/agents-md.md)
- [Write stories](https://storybook.js.org/docs/11/ai/skills/write-stories.md)
- [Best practices for using Storybook with AI](https://storybook.js.org/docs/11/ai/best-practices.md)
- [Manifests](https://storybook.js.org/docs/11/ai/reference/manifests.md)
- [Use a published Storybook](https://storybook.js.org/docs/11/ai/published-storybook.md)