Skip to content

Commit b68c71e

Browse files
committed
add information about React-styleguidist
1 parent 9ce0aa5 commit b68c71e

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

packages/react-scripts/template/README.md

+27-2
Original file line numberDiff line numberDiff line change
@@ -900,11 +900,16 @@ For an example, a simple button component could have following states:
900900
901901
Usually, it’s hard to see these states without running a sample app or some examples.
902902
903-
Create React App doesn't include any tools for this by default, but you can easily add [React Storybook](https://github.com/kadirahq/react-storybook) to your project. **It is a third-party tool that lets you develop components and see all their states in isolation from your app**.
903+
Create React App doesn't include any tools for this by default, but there are some **third-party tools**, that that let you develop components and see all their states in isolation from your app:
904+
905+
* [React-storybook](https://github.com/kadirahq/react-storybook)
906+
* [React-styleguidist](https://github.com/styleguidist/react-styleguidist)
907+
908+
### Getting started with Storybook
904909
905910
![React Storybook Demo](http://i.imgur.com/7CIAWpB.gif)
906911
907-
You can also deploy your Storybook as a static app. This way, everyone in your team can view and review different states of UI components without starting a backend server or creating an account in your app.
912+
You can build your Storybook as a static app. This way, everyone in your team can view and review different states of UI components without starting a backend server or creating an account in your app.
908913
909914
**Here’s how to setup your app with Storybook:**
910915
@@ -929,6 +934,26 @@ Learn more about React Storybook:
929934
* [Documentation](https://getstorybook.io/docs)
930935
* [Snapshot Testing](https://github.com/kadirahq/storyshots) with React Storybook
931936
937+
## Getting started with Styleguidist
938+
939+
[React-styleguidist](https://github.com/sapegin/react-styleguidist) is another tool that gives you an isolated sandbox, where you can develop your components independently. The difference between this and tool Storybook mentioned before is that Styleguidist automatically builds component index for you. It finds all React-components, understand PropTypes definition and creates a kind of documentation. You can extend this information by adding `Readme.md` file in the folder with your components. React-styleguidist will find all code snippets and will compile them, so you will get your examples alive. See [its documentation](https://github.com/sapegin/react-styleguidist/blob/master/docs/GettingStarted.md#documenting-components) to get more information.
940+
941+
To start using this with Create React App you need to install `react-app-styleguidist` – an integration of React-styleguidist into Create React App-based environment:
942+
943+
```
944+
npm install react-app-styleguidist --save-dev
945+
```
946+
947+
Then add `styleguide` into `scripts` section in your package.json
948+
949+
```
950+
"styleguide": "styleguidist server ./src/App.js"
951+
```
952+
953+
Then you can run `npm run styleguide` and see the initial version of the styleguide. Then you can modify your components, document additional prop types or add more examples, your code will be automatically rebuilt and webpage – reloaded.
954+
955+
In case, if you want to have more control on React-styleguidist and change some properties there, you can also perform the `eject` process, which is described [there](https://github.com/just-boris/react-app-styleguidist#ejecting). (This is only about React-styleguidist ejection, not the whole Create React App).
956+
932957
## Making a Progressive Web App
933958
934959
You can turn your React app into a [Progressive Web App](https://developers.google.com/web/progressive-web-apps/) by following the steps in [this repository](https://github.com/jeffposnick/create-react-pwa).

0 commit comments

Comments
 (0)