Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joeybaker/storybook-addon-smart-knobs
Automatically created knobs for storybook. Forked version add support for withInfo addon.
https://github.com/joeybaker/storybook-addon-smart-knobs
Last synced: 6 days ago
JSON representation
Automatically created knobs for storybook. Forked version add support for withInfo addon.
- Host: GitHub
- URL: https://github.com/joeybaker/storybook-addon-smart-knobs
- Owner: joeybaker
- Created: 2017-04-02T15:58:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-02T16:02:14.000Z (almost 8 years ago)
- Last Synced: 2024-12-26T17:07:48.548Z (20 days ago)
- Language: JavaScript
- Size: 317 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Smart knobs addon for Storybook
This Storybook plugin uses storybook-addon-knobs but creates the knobs automatically based on PropTypes.
This fork is compatible with [@kadira/react-storybook-addon-info](https://github.com/kadirahq/react-storybook-addon-info).
## Installation:
```
npm i storybook-addon-smart-knobs --save-dev
```## Usage:
```js
import React, { PropTypes } from 'react'
import { storiesOf } from '@kadira/storybook'
import { withKnobs } from '@kadira/storybook-addon-knobs'
import { withSmartKnobs } from 'storybook-addon-smart-knobs'const Button = ({ children, onClick }) => (
{ children }
)Button.propTypes = {
children: PropTypes.node,
onClick: PropTypes.func
}storiesOf('Button')
.addDecorator(withSmartKnobs)
.addDecorator(withKnobs)
.add('simple', () => Smart knobed button)```