1 | # Smart knobs addon for Storybook
|
2 |
|
3 | ## Usage:
|
4 |
|
5 | ```js
|
6 | import React, { PropTypes } from 'react'
|
7 | import { storiesOf } from '@kadira/storybook'
|
8 | import { withKnobs } from '@kadira/storybook-addon-knobs'
|
9 | import { withSmartKnobs } from 'storybook-addon-smart-knobs'
|
10 |
|
11 | const Button = ({ children, onClick }) => (
|
12 | <button onClick={ onClick }>{ children }</button>
|
13 | )
|
14 |
|
15 | Button.propTypes = {
|
16 | children: PropTypes.node,
|
17 | onClick: PropTypes.func
|
18 | }
|
19 |
|
20 | storiesOf('Button')
|
21 | .addDecorator(withSmartKnobs)
|
22 | .addDecorator(withKnobs)
|
23 | .add('simple', () => <Button>Smart knobed button</Button>)
|
24 |
|
25 | ```
|