UNPKG

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