All Projects â†’ storybookjs â†’ Addon Smart Knobs

storybookjs / Addon Smart Knobs

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Addon Smart Knobs

storybook-addon-headless
A Storybook addon to preview content from a headless CMS in components
Stars: ✭ 23 (-89.3%)
Mutual labels:  addon, storybook
Addon Jsx
This Storybook addon show you the JSX / template of the story
Stars: ✭ 209 (-2.79%)
Mutual labels:  addon, storybook
storybook-styled-components
No description or website provided.
Stars: ✭ 76 (-64.65%)
Mutual labels:  addon, storybook
storybook-addon-next
A no config Storybook addon that makes Next.js features just work in Storybook
Stars: ✭ 184 (-14.42%)
Mutual labels:  addon, storybook
Storybook Addon
Develop themable components with Emotion/Styled Components/Material-UI with help of Storybook & React Theming
Stars: ✭ 122 (-43.26%)
Mutual labels:  addon, storybook
create-material-ui-app
create-react-app + storybook + storybook-addon-material-ui
Stars: ✭ 55 (-74.42%)
Mutual labels:  addon, storybook
Storycap
A Storybook Addon, Save the screenshot image of your stories 📷 via puppeteer.
Stars: ✭ 451 (+109.77%)
Mutual labels:  addon, storybook
storybook-addon-mock
This addon allows you to mock fetch or XMLHttpRequest in the storybook.
Stars: ✭ 67 (-68.84%)
Mutual labels:  addon, storybook
Storybook Addon Preview
Storybook Addon Preview can show user selected knobs in various framework code in Storybook
Stars: ✭ 43 (-80%)
Mutual labels:  addon, storybook
Storybook Addon A11y
REPO/PACKAGE MOVED - Storybook addon to help, improving accessibility within you're react components.
Stars: ✭ 37 (-82.79%)
Mutual labels:  addon, storybook
storybook-xstate-addon
A storybook addon to assist with writing stories that rely on xstate
Stars: ✭ 48 (-77.67%)
Mutual labels:  addon, storybook
Storybook Addon Styled Component Theme
storybook addon
Stars: ✭ 168 (-21.86%)
Mutual labels:  addon, storybook
msw-storybook-addon
Mock API requests in Storybook with Mock Service Worker.
Stars: ✭ 168 (-21.86%)
Mutual labels:  addon, storybook
Storybook Addon Material Ui
Addon for storybook wich wrap material-ui components into MuiThemeProvider. 📃 This helps and simplifies development of material-ui based components.
Stars: ✭ 513 (+138.6%)
Mutual labels:  addon, storybook
React Storybook Addon Props Combinations
Given possible values for each prop, renders your component with all combinations of prop values.
Stars: ✭ 130 (-39.53%)
Mutual labels:  addon, storybook
Storybook Addon Jest
REPO/PACKAGE MOVED - React storybook addon that show component jest report
Stars: ✭ 177 (-17.67%)
Mutual labels:  addon, storybook
Minishift
Run OpenShift 3.x locally
Stars: ✭ 2,246 (+944.65%)
Mutual labels:  development-tools
Ember Power Calendar
Powerful and customizable calendar component for Ember
Stars: ✭ 200 (-6.98%)
Mutual labels:  addon
Min Vid
Popout video player in Firefox
Stars: ✭ 180 (-16.28%)
Mutual labels:  addon
Awesome Discord
🕹 A curated list of awesome things on Discord.
Stars: ✭ 180 (-16.28%)
Mutual labels:  addon

Smart knobs addon for Storybook

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

Installation:

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

Usage:

import React from 'react'
import PropTypes from 'prop-types'
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(options))
  .addDecorator(withKnobs)
  .add('simple', () => <Button>Smart knobed button</Button>)

Options

  • ignoreProps

    Type: Array

    Will not automatically create knobs for props whose name is in this array. Example:

      .withSmartKnobs({ ignoreProps: ['numberProp'] })
      .add('example', () => <div numberProp={date('date', date)} />) 
    

Configuration:

This plugin has a peer dependency on babel-plugin-react-docgen . As a result, babel-plugin-react-docgen needs to be added to your Storybook Babel configuration.

For a standard Storybook configuration, add react-docgen to your plugins in an appropriate .babelrc file.

If you have created a webpack.config.js file for Storybook, you may need to configure the plugin in there.

module.exports = (baseConfig, env, defaultConfig) => {
  defaultConfig.module.rules[0].use[0].options.plugins = [
    require.resolve('babel-plugin-react-docgen'),
  ]

  return defaultConfig
}

Typescript:

Use react-docgen-typescript-loader to generate docgen info from Typescript types. This docgen info will be used to automatically create knobs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].