react-storybook-addon-add-stories-group

0.1.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i react-storybook-addon-add-stories-group

Weekly Downloads

11

Version

0.1.0

License

MIT

Last publish

Collaborators

  • jurgo