Skip to content

Commit

Permalink
Merge pull request #15417 from vidhill/feature/document-story-descrip…
Browse files Browse the repository at this point in the history
…tion

Document how to add individual story description, see #8527 #10823
  • Loading branch information
shilman committed Jun 30, 2021
2 parents 09af5e4 + e1a4b2c commit 221b467
Showing 1 changed file with 19 additions and 0 deletions.
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

0 comments on commit 221b467

Please sign in to comment.