react-demo-tab-cli

CLI tool for creating demos of React components

Usage no npm install needed!

<script type="module">
  import reactDemoTabCli from 'https://cdn.skypack.dev/react-demo-tab-cli';
</script>

README

React DemoTab CLI 📑

npm version build status oclif prettier

Easily create demos of React components

Maintaining example code and demo separately makes it painful, it's easy to get them out of sync 🙅

Code can't lie, demo code can 💥

DemoTab CLI keeps your code up to date with demo 💪

Install

npm install -D react-demo-tab react-demo-tab-cli

Demo

DemoTab example

Usage (3 steps)

To use CLI in your project:

  1. default export react components that you wish to create demos of
  2. name component file as [filename].demotab.[ext]
  3. run $ npx demotab generate

Use created demos 🎉

Generated Demos

  • By default generated demo files will be prefixed with _ for example:
    MyComponent.demotab.jsx & MyComponent.demotab.css -> _MyComponent.jsx
  • You can set custom prefix with --prefix flag:
    $ demotab generate --prefix=CustomPrefix

Built with DemoTab

Manually create demos

If you wish to manually create demos instead via CLI, see React DemoTab.

License

MIT