1.0.0 • Published 4 years ago

story-description-loader v1.0.0

Weekly downloads
261
License
MIT
Repository
github
Last release
4 years ago

Storybook Description Loader

Add JSDoc comments to your storybook examples that show up on your DocsPage.

Usage

Code

// A `primary` button is used for emphasis.
export const Primary = () => <Button primary>Submit</Button>

/**
 * Use the `loading` prop to indicate progress. Typically use
 * this to provide feedback when triggering asynchronous actions.
 */
export const Loading = () => <Button loading>Loading</Button>

Rendered docs

npm.io

Installation

1. Installing package

You'll need to have Storybook and the Docs Addon installed. Then run:

npm install --save-dev story-description-loader

2. Adding to Webpack

If using JSX

module: {
  rules: [
    {
      test: /\.stories\.jsx/,
      use: [{ loader: “story-description-loader”, options: { isJSX: true } }],
  ]
}

If using TSX

module: {
  rules: [
    {
      test: /\.stories\.tsx/,
      use: [{ loader: “story-description-loader”, options: { isTSX: true } }],
  ]
}

Or plain old JS

module: {
  rules: [
    {
      test: /\.stories\.tsx/,
      use: [{ loader: “story-description-loader” }],
  ]
}