1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-storybook/stories/index.stories.js
Gary Meehan 0da53a1444 Add [with-storybook] example (#4588)
The purpose of the PR is to add the simplest possible integration with Storybook. 

It leaves the default Storybook and also adds a custom component to show how it would be used in both the app and Storybook.

Update: 
Tested with latest 👉  6.1.1
2018-06-29 22:24:44 +02:00

27 lines
752 B
JavaScript

import React from 'react'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import { linkTo } from '@storybook/addon-links'
import { Button, Welcome } from '@storybook/react/demo'
import HelloWorld from '../components'
storiesOf('Welcome', module).add('to Storybook', () => (
<Welcome showApp={linkTo('Button')} />
))
storiesOf('Button', module)
.add('with text', () => (
<Button onClick={action('clicked')}>Hello Button</Button>
))
.add('with some emoji', () => (
<Button onClick={action('clicked')}>
<span role='img' aria-label='so cool'>
😀 😎 👍 💯
</span>
</Button>
))
storiesOf('HelloWorld', module).add('simple component', () => <HelloWorld />)