JSON to HTML generator with colors and collapsible brackets.
npm install react-pretty-jsonreact-pretty-json
=================



react-pretty-json in your project:
sh
$ npm install react-pretty-json
`
2) Import package and pass JSON.
`typescript
import JsonView from 'react-pretty-json';
// ...
render() {
let obj = {
example: 'string',
number: 123,
boolean: true
};
return ;
}
`
3) (Optional) Importing styles. You can reach it with react-pretty-json/assets/json-view.css'.
typescript
import 'react/pretty-json/assets/json-view.css!';
`
Component props
| Prop | Type | Default | Description |
|---------|--------|---------|----------------------------------------|
| json* | object | none | Generate object. |
| spaces | number | 4 | Parts that will be generated js files. |
*` - Required.