react-demo-page
ReactDemoPage let you build a demo page for your react component with ease
Getting started
You can download react-demo-page
from the NPM registry via the npm
or yarn
commands
yarn add react-demo-pagenpm install react-demo-page --save
If you don't use package manager and you want to include react-demo-page
directly in your html, you could get it from the UNPKG CDN
https://unpkg.com/react-demo-page/dist/react-demo-page.min.js.
Usage
const routes = // A page with only html path: "/" exact: true html: html label: "Home" // A page with demo component and html as presentation path: "/demo" demo: component: <YourReactComponent /> html: html label: "Demo" // A custom page path: "/myCustomPage" component: <div> <h2>"Title"</h2> <YourReactComponent /> </div> label: "Custom page" const header = title: pkgname buttons: label: "Github" url: pkghomepage label: "Npm" url: `https://www.npmjs.com/package/` label: "Download" url: `/archive/master.zip` const footer = author: pkgauthor const Demo = <ReactDemoPage basename=pkgname // You need this if you deploy on Github page header=header footer=footer pages=routes color="#3498db" />
If you need to watch and build your demo page to deploy it but you don`t want a lot of configuration, I recommend you to use nwb and gh-pages:
yarn add nwb gh-pages --dev
and add these scripts to your package.json
:
Demo
See Demo page
Contributing
- ⇄ Pull/Merge requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests (
npm test
).
See CONTRIBUTING.md guidelines
Changelog
See changelog
License
This project is licensed under the MIT License - see the LICENCE.md file for details