storybook-addon-smart-knobs-flow
v3.2.11
Published
Automatically created knobs for storybook.
Downloads
3
Readme
Smart knobs addon for Storybook
This Storybook plugin uses @storybook/addon-knobs
but creates the knobs automatically based on PropTypes.
Installation:
npm i storybook-addon-smart-knobs --save-dev
Usage:
import React, { PropTypes } from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs } from '@storybook/addon-knobs'
import { withSmartKnobs } from 'storybook-addon-smart-knobs'
const Button = ({ children, onClick }) => (
<button onClick={ onClick }>{ children }</button>
)
Button.propTypes = {
children: PropTypes.node,
onClick: PropTypes.func
}
storiesOf('Button')
.addDecorator(withSmartKnobs)
.addDecorator(withKnobs)
.add('simple', () => <Button>Smart knobed button</Button>)