react-pretty-json

2.0.2 • Public • Published

react-pretty-json

NPM version dependencies Status devDependencies Status

Get started

  1. Install react-pretty-json in your project:
$ npm install react-pretty-json
  1. Import package and pass JSON.
import JsonView from 'react-pretty-json';
 
// ...
 
render() {
    let obj = {
        example: 'string',
        number: 123,
        boolean: true
    };
    return <JsonView json={obj} />;
}
 
  1. (Optional) Importing styles. You can reach it with `react-pretty-json/assets/json-view.css'.
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.

License

GPL-3.0

Readme

Keywords

Package Sidebar

Install

npm i react-pretty-json

Weekly Downloads

151

Version

2.0.2

License

GPL-3.0

Last publish

Collaborators

  • quatrodev