material-component-demo
v0.1.0
Published
A React component for demoing React components, optionally with source code
Downloads
4
Maintainers
Readme
A component that allows easy display of nice-looking React component demos, with optional source code display. Designed for easy interoperation with demo-source-loader
.
Props
| Prop name | Type | Required? | Description |
| --------- | ---- | --------- | ----------- |
| DemoComponent
| React component | yes | A component containing an operational demo of your compontn. This should not be your actual documented component, but a wrapper that provides any necessary props, state management, imports, etc. |
| title
| string | yes | A brief description of the feature being demonstrated |
| demoSource
| string | no | The source code of the demo component. This will be displayed with syntax highlighting below the demo, and can be expanded and collapsed with a toggle. If not supplied, the toggle will be missing. |
| markdown
| string | no | An explanation of the feature being demonstrated, in Markdown format. |
| children
| React node | no | An explanation of the feature being demonstrated, as a React component. This will be ignored if the markdown
prop is supplied |
All other props will be spread to the root DOM node.