react-component-permutations
WIP
Uses propTypes to create an array of React component props to display various permutations.
npm i react-component-permutations
Usage
const src = fsconst options = {}const permutations =
Options
strings
- Array - strings to render forPropType.string
numbers
- Array - numbers to render forPropType.number
arrays
- Array - arrays to render forPropType.array
objects
- Array - objects to render forPropType.object
nodes
- Array - nodes to render forPropTypes.node
[key]
- Array - any prop name to add to the returned objects array
Demo
Given a button component with these propTypes
:
ButtonpropTypes = big: ReactPropTypesbool color: ReactPropTypes pill: ReactPropTypesbool outline: ReactPropTypesbool
The rendered result would look something like this:
http://jxnblk.com/react-component-permutations/demo
See the /demo
folder.
MIT License