-
Install Styleguidist and peer dependencies from npm:
npm install --save-dev react-styleguidist react react-dom webpack
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@1Add these scripts to your package.json:
{
"scripts": {
"styleguide": "styleguidist server",
"styleguide:build": "styleguidist build"
}
}Run npm run styleguide to start style a guide dev server.
Run npm run styleguide:build to build a static version.
See how to document your components