2.2.0 • Published 8 years ago

react-storybook-story v2.2.0

Weekly downloads
21
License
MIT
Repository
github
Last release
8 years ago

React Storybook Story

A component to add additional information with your react-storybook stories.

React Storybook Screenshot

To get started, install the module as a devDependency

npm install -D react-storybook-story

When writing stories, wrap your component with the <Story /> component and use the info parameter to give additional info.

import {storiesOf} from '@kadira/storybook';
import Story from 'react-storybook-story';
import 'react-storybook-story/styles.css';

storiesOf('<MyComponent />', module)
  .add('my-example-story', function () {
    const info = `
      This story will render **MyComponent** with the
      _foo_ parameter set to "bar"
    `;
    return (
      <Story info={info}>
        <MyComponent foo={'bar'} />
      </Story>
    );
  });

The FAQ

Error loading styles.css file

To load the stylesheet make sure your webpack config has style-loader and raw-loader setup properly. Modify your .storybook/webpack.config.js file to include the style-loader.

const path = require('path');

module.exports = {
  module: {
    loaders: [
      {
        test: /\.css?$/,
        loaders: ['style', 'raw'],
        include: path.resolve(__dirname, '../'),
      },
    ],
  },
};

Credits

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.4.0

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago