storybooks/addon-smart-knobs

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Smart knobs addon for Storybook

This Storybook plugin uses @storybook/addon-knobs but creates the knobs automatically based on PropTypes.

Installation:
i storybook-addon-smart-knobs --save-dev
Usage:
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>)

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.