Storybook README addon
NOTE: This README only for version ^5.0.0
. For older versions LEGACY_README.md
This addon is compatible with:
- Storybook for React (React example storybook)
- Storybook for Vue (Vue example storybook)
Features:
- Automatically generate props table (Only for React)
- Does not affect on story function. So Storybook Info works correctly now.
- 100% markdown support
- Code highlighting
- Accept multiple README (useful for hoc component - add component's and original component's README)
- Looks like Github's README
- Supports
<docs/>
tags for vue components (example-vue/components/MyButton/MyButton.vue).
Also it very useful because most projects and components already have README.md files. Now it is easy to add them into your Storybook.
Stories will be added with .addWithInfo method if Storybook Info Addon is installed.
Install
npm install --save-dev storybook-readme
or
yarn add --dev storybook-readme
Webpack Configuration for React Storybook
Nothing to do :)
Webpack Configuration for Vue Storybook
Only if using Single File Components and want to use <docs>
tag at storybook documentation.
module { storybookBaseConfigmodulerules;};
Define <docs>
tag inside vue module:
<docs>Docs inside vue module </docs> <template> <button class="button"> <slot></slot> </button></template>
Use it to defone docs at story:
; ;
Setup
Register addon at .storybook/addons.js
;
Add decorator at .storybook/config.js
;;
Usage
Hope it is very simple.
;; ;; ;
It is possible to override docs for story
;; ;; ;
Full list of options
Will be applied for series of stories.
Global configuration
Will be applied for all stories.
NOTE: that global configuration
is applied only for content docs (docs around the story).
; ;
Readme placeholders
<!-- STORY -->
placeholder for story<!-- PROPS -->
placeholder for props table
Button variants could be imported separately. \`\`\`js import { OutlinedButton, ContainedButton, TextButton } from 'Button'; \`\`\` <!-- PROPS --> Example: <!-- STORY --> Some docs after story
Emoji
Use shortcodes between colon to insert emoji into the docs. For example
Here is rocket 🚀
Here is rocket 🚀
List of all shortcodes could be found at Emojipedia or at Gist/rxaviers
- 🚀
- 😀
- 🐒
Fell free to suggest new features or report bugs :)