React Component Demo
A React Component To make live editable demos of other React Components. Great for documentation.
Demo
Install
npm install react-component-demo --save
Use
props
Component
- the Component to demo.name
- the name of the Component, will use Component.displayName if not provided.props
- an object with the props for the component (these will be editable)codeContainerStyle
- optional prop to edit style of code containercomponentContainerStyle
- optional prop to edit style of component container- Any other props will be transferred to the root element
import React from 'react';import render from 'react-dom';import ComponentDemo from 'react-component-demo'; { return <div => React Component Demo </div> ;} { return <ComponentDemo = ='TestComponent' = = = /> ;} ;