Skip to content

jurgob/react-storybook-addon-add-stories-group

 
 

Repository files navigation

React Storybook Info Addon

A React Storybook addon to show additional information for your stories.

React Storybook Screenshot

Usage

Install the following npm module:

npm i --save-dev react-storybook-addon-add-stories-group
import { configure,setAddon } from '@kadira/storybook';
import addStoriesGroup from 'react-storybook-addon-add-stories-group'

setAddon(addStoriesGroup)

function loadStories() {
  require('../src/components/stories/MyComp');
  // require as many stories as you need.
}

configure(loadStories, module);

Then create your stories with the .addWithInfo API.

import { action , storiesOf} from '@kadira/storybook';
import MyComp from '../MyComp';

const stories = [
  {
    name:"with text" ,
    props: {text:"super error props", resetErrorMessage: action('clicked!') }
  },
  {
    name:"with very long text",
    props: {text:"super error this is a reaaaaaalllly long error, probably more than one line of text, even if you have a huge monitor, text text", resetErrorMessage: action('clicked!') }
  }
]

storiesOf('MyComp', module)
  .addStoriesGroup(MyComp, stories)

Have a look at this example stories to learn more about the addWithInfo API.

About

A React Storybook addon to add groups of stories and show them all together

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 81.1%
  • Shell 18.9%