Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kadira/react-storybook-addon-info

kadirahq854MIT3.4.0

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

readme

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 -D @kadira/react-storybook-addon-info

Then set the addon in the place you configure storybook like this:

import { configure, setAddon } from '@kadira/storybook';
import infoAddon from '@kadira/react-storybook-addon-info';

setAddon(infoAddon);

configure(function () {
  ...
}, module);

Then create your stories with the .addWithInfo API.

import React from 'react';
import Button from './Button';
import { storiesOf, action } from '@kadira/storybook';

storiesOf('Button')
  .addWithInfo(
    'simple usage',
    `
      This is the basic usage with the button with providing a label to show the text.
    `,
    () => (
      <div>
        <Button label="The Button" onClick={action('onClick')}/>
        <br />
        <p>
          Click the "?" mark at top-right to view the info.
        </p>
      </div>
    ),
  );

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

The FAQ

Components lose their names on static build

Component names also get minified with other javascript code when building for production. When creating components, set the displayName static property to show the correct component name on static builds.

changelog

Change Log

v3.3.0

  • Add setDefaults function PR114

v3.2.4

  • Add missing dist files PR113

v3.2.3

  • Handle number type nodes PR110

v3.2.2

  • Use markdown-to-react-components npm package instead of our fork. Our PR to them is merged and published. PR109

v3.2.1

  • Handle false values for types PR54

v3.2.0

  • Support custom MTRC config PR54
  • Fix propTables prop validation with a default value PR55

v3.1.4

  • Remove propTables prop validation warning PR53
  • Update example storybook PR52

v3.1.3

  • Fix wrong detection of propType when isRequired is set PR49
  • Add displayName for Button PR51

v3.1.2

  • Fixed a bug which made the info to not display and the options parameter to be ignored when info is not given.PR45

v3.1.1

  • Add a z-index for rendered items to make the overlay always display on top PR38

v3.1.0

  • Make the info argument optional PR37

v3.0.10

  • Render the component inside a div element when on inline mode PR34

v3.0.9

  • Add missing @kadira/storybook devDependencies PR25
  • Improve prop rendering in jsx source view PR24
  • Avoid warning message with "webkitFontSmoothing" PR30
  • Remove max-width style rule for wrapper PR31 and PR36
  • Improve prop table rendering (handle css resets) PR32

v3.0.8

  • Fixed unkeyed array iteration warning in React with: PR23

v3.0.7

  • Improve default display in prop table. See #16

v3.0.6

  • Improve function type and react element type props display. See #14

v3.0.5

  • Over-indentation of ending tag in source code is fixed. See #13

v3.0.4

  • Remove the need to use json-loader with webpack when using this package. See: #12

v3.0.0

  • Add the version which works as an React Storybook addon.