React DocTab 📑
Generate React component as Live Demo & Code Example
Maintaining example code and live demo separately makes it painful, it's easy to get them out of sync 🙅
Code can't lie, example code can 💥
DocTab keeps your example code up to date with live demo 💪
Install
npm install -D react-doc-tab react-doc-tab-template
Demo
DocTab live demo
Usage
To use DocTab in your project:
- default export component
- name file as
[filename].doctab.[ext]
- run
$ npx doctab generate
Import generated DocTab components. 🎉
Generated DocTab Files
- By default generated files will be prefixed with
_
for example:
MyComponent.doctab.jsx
& MyComponent.doctab.css
-> _MyComponent.jsx
- You can set custom prefix with
--prefix
flag:
$ doctab generate --prefix=CustomPrefix
Built with DocTab
License
MIT