GithubHelp home page GithubHelp logo

neusoft-psd / react-storybook-story Goto Github PK

View Code? Open in Web Editor NEW

This project forked from storybook-eol/react-storybook-addon-info

1.0 2.0 1.0 1019 KB

Render react-storybook stories with additional information

Home Page: https://kadirahq.github.io/react-storybook-story

License: MIT License

JavaScript 89.42% Shell 2.80% CSS 7.78%

react-storybook-story's Introduction

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

react-storybook-story's People

Contributors

thani-sh avatar roonyh avatar wwfalcon avatar

Stargazers

Alpha Hinex avatar

Watchers

James Cloos avatar  avatar

Forkers

wwfalcon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.