react-json-to-html
A simple React component that renders and HTML table from a JSON object.
Installation
npm install react-json-to-html --save
Usage
A simple example. Download and run the demo for more examples, or browse the examples here.
import React from 'react';
import JsonTable from 'react-json-to-html';
class Nested extends React.Component {
const json = {
"Server Name": "foo",
"Description": "bar",
"Specs": {
"IP": "10.100.99.101",
"MAC": "00:0a:XX:9F:XX:16"
},
"Date": "Jan 1, 2018"
}
render() {
return (
<JsonTable json={json} />
)
}
}
export default JsonTable;
JsonTable props
Name | Type | Required | Default | Possible Values | Description |
---|
json | [Object] | Yes | undefined | Any valid JSON object | The JSON that will get rendered as HTML table |
Download Examples
git clone https:
cd react-json-to-html
npm install
gulp demo
Browse http:
Backlog
- Add more props to control styling and CSS
- More tests