Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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)

```