Name: addon-smart-knobs
Owner: Storybook
Description: This Storybook plugin uses @storybook/addon-knobs but creates the knobs automatically based on PropTypes.
Created: 2016-10-19 20:02:15.0
Updated: 2018-05-03 20:36:55.0
Pushed: 2018-01-22 23:15:48.0
Homepage: https://storybooks.js.org
Size: 467
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This Storybook plugin uses @storybook/addon-knobs
but creates the knobs automatically based on PropTypes.
i storybook-addon-smart-knobs --save-dev
rt React, { PropTypes } from 'react'
rt { storiesOf } from '@storybook/react'
rt { withKnobs } from '@storybook/addon-knobs'
rt { withSmartKnobs } from 'storybook-addon-smart-knobs'
t Button = ({ children, onClick }) => (
utton onClick={ onClick }>{ children }</button>
on.propTypes = {
ildren: PropTypes.node,
Click: PropTypes.func
iesOf('Button')
ddDecorator(withSmartKnobs)
ddDecorator(withKnobs)
dd('simple', () => <Button>Smart knobed button</Button>)