1.0.0 • Published 4 years ago

prop-types-table v1.0.0

Weekly downloads
11
License
Apache-2.0
Repository
github
Last release
4 years ago

prop-types-table

create a markdown table documenting a React component's propTypes

Adapted from material-ui's PropTypeDescription component: https://github.com/callemall/material-ui/blob/82482758573dc714b210529dcf092dab904db0ba/docs/src/app/components/PropTypeDescription.js

Install - Usage - License: Apache-2.0

npm travis standard

Install

npm install prop-types-table

Usage

prop-types-table src/index.js > generated-docs.md

The result looks a bit like this:

NameTypeDefaultDescription
videostringAn 11-character string representing a YouTube video ID..
idstringDOM ID for the player element.
classNamestringCSS className for the player element.
widthnumber, stringWidth of the player element.
heightnumber, stringHeight of the player element.
onCuedfunction() => {}Sent when the video is cued and ready to play.
onBufferingfunction() => {}Sent when the video is buffering.

You can use this together with md-insert to put prop type documentation for components into your markdown readme.

prop-types-table src/index.js | md-insert -i README.md --header Props

License

Apache-2.0