Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 08a4be7

Browse files
Added README.
1 parent 5270d93 commit 08a4be7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
```

0 commit comments

Comments
 (0)