react-docgen-props-table (demo)
Beautiful Props Table for React Docgen.
This is a standalone version of the (now deprecated) PropsTable
component from Docz.
npm install --save react-docgen-props-table
import React, { Component } from 'react'
import PropsTable from 'react-docgen-props-table'
// this was generated via react-docgen
const docgenInfo = {
"description": "General component description.",
"displayName": "MyComponent",
"methods": [],
"props": {
"foo": {
"type": {
"name": "number"
},
"required": true,
"description": "Description foo."
},
"bar": {
"type": {
"name": "string"
},
"required": false,
"description": "Description bar.\n\n- markdown list-item 1\n- markdown list-item 2",
"defaultValue": {
"value": "'bar'",
"computed": false
}
},
"baz": {
"type": {
"name": "bool"
},
"required": false,
"description": "Description baz."
}
}
}
class Example extends Component {
render () {
return (
<PropsTable props={docgenInfo.props} />
)
}
}
Check out the demo for live examples.
Credit goes to Pedro Nauck and docz for the initial implementation.
MIT © transitive-bullshit
Support my OSS work by following me on twitter