Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 1.22 KB

File metadata and controls

49 lines (31 loc) · 1.22 KB

Getting Started with React Styleguidist

1. Install Styleguidist

  1. Install Styleguidist and peer dependencies from npm:

    npm install --save-dev react-styleguidist react react-dom webpack
  2. Point Styleguidist to your React components

  3. Tell Styleguidist how to load your code

Note: Webpack is a peer dependency but your project doesn’t have to use it. Styleguidist works with webpack 1 and webpack 2.

If you’re using create-react-app you only need this:

npm install --save-dev react-styleguidist webpack@1

2. Add npm scripts for convenience (optional)

Add these scripts to your package.json:

{
  "scripts": {
    "styleguide": "styleguidist server",
    "styleguide:build": "styleguidist build"
  }
}

3. Start your style guide

Run npm run styleguide to start style a guide dev server.

Run npm run styleguide:build to build a static version.

4. Start documenting your components

See how to document your components

Have questions?