@joeybaker/storybook-addon-smart-knobs

1.0.0 • Public • Published

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.

Installation:

npm i storybook-addon-smart-knobs --save-dev

Usage:

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 }) => (
  <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>)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.00latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.00

Package Sidebar

Install

npm i @joeybaker/storybook-addon-smart-knobs

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • joeybaker