Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to add individual story description, see #8527 #10823 #15417

Merged
merged 5 commits into from Jun 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions addons/docs/docs/recipes.md
Expand Up @@ -17,6 +17,7 @@
- [Reordering Docs tab first](#reordering-docs-tab-first)
- [Customizing source snippets](#customizing-source-snippets)
- [Overwriting docs container](#overwriting-docs-container)
- [Add description to individual stories](#add-description-to-individual-stories)
- [More resources](#more-resources)

## Component Story Format (CSF) with DocsPage
Expand Down Expand Up @@ -336,6 +337,24 @@ import { theme } from '../path/to/theme'
Rest of your file...
```

## Add description to individual stories

Add `story` to `docs.description` parameter

```js
const Example = () => <Button />;

Example.parameters = {
docs: {
description: {
story: "Individiual story description, may conatin `markdown` markup"
},
},
};
```

There is also an webpack loader package that extracts descriptions from jsdoc comments [story-description-loader](https://www.npmjs.com/package/story-description-loader)

## More resources

- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md) / [Props](props-tables.md)
Expand Down