Skip to content

Commit d944a9d

Browse files
committed
Docs: React Storybook v. React Styleguidist
Closes styleguidist#620.
1 parent 74e58c4 commit d944a9d

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

docs/Cookbook.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,60 @@ See in [configuring webpack](Webpack.md#reusing-your-projects-webpack-config).
297297

298298
See [working with third-party libraries](Thirdparties.md).
299299

300+
## What’s the difference betweeen Styleguidist and Storybook
301+
302+
Both tools are good and mature, they have many similarities but also some distinctions that may make you choose one or the other. For me the biggest distinction is how you describe component variations.
303+
304+
With Storybook you write *stories* in JavaScript files:
305+
306+
```js
307+
import React from 'react';
308+
import { storiesOf } from '@storybook/react';
309+
import { action } from '@storybook/addon-actions';
310+
import Button from '../components/Button';
311+
312+
storiesOf('Button', module)
313+
.add('default', () => (
314+
<Button onClick={action('clicked')}>Push Me</Button>
315+
))
316+
.add('large size', () => (
317+
<Button size="large">Push Me</Button>
318+
));
319+
```
320+
321+
![Storybook screenshot](https://storybook.js.org/2c663defce0e8f4d0c256e911f74b727.gif)
322+
323+
And with Styleguidist you write *examples* in Markdown files:
324+
325+
React button component example:
326+
327+
```js
328+
<Button onClick={() => console.log('clicked')>Push Me</Button>
329+
```
330+
331+
Large size:
332+
333+
```js
334+
<Button size="large">Push Me</Button>
335+
```
336+
337+
![Styleguidist screenshot](https://camo.githubusercontent.com/7af8e5fc43288807978f28530656275008c5afbf/68747470733a2f2f64337676366c703535716a6171632e636c6f756466726f6e742e6e65742f6974656d732f32373142333732783130325330633035326933462f72656163742d7374796c6567756964697374372e676966)
338+
339+
Another important distinction is that Storybook shows only one variation of one component at a time but Styleguidist can show all variations of all components, all variations of a single component or one variation.
340+
341+
| Feature | Storybook | Styleguidist |
342+
| ------- | --------- | ------------ |
343+
| Component examples | JavaScript | Markdown |
344+
| Props docs | Yes | Yes |
345+
| Public methods docs | No | Yes |
346+
| Style guide¹ | No | Yes |
347+
| Customizable design | No | Yes |
348+
| Extra documentation | No | Yes |
349+
| Plugins | Many | No² |
350+
351+
¹ All components on a single page.
352+
² [In development](https://github.com/styleguidist/react-styleguidist/issues/354).
353+
300354
## Are there any other projects like this?
301355

302356
* [Atellier](https://github.com/scup/atellier), a React components emulator.

0 commit comments

Comments
 (0)