File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ react-pretty-json
2+ =================
3+ [ ![ NPM version] ( http://img.shields.io/npm/v/react-pretty-json.svg )] ( https://www.npmjs.com/package/react-pretty-json )
4+ [ ![ dependencies Status] ( https://david-dm.org/quatrocode/react-pretty-json/status.svg )] ( https://david-dm.org/quatrocode/react-pretty-json )
5+ [ ![ devDependencies Status] ( https://david-dm.org/quatrocode/react-pretty-json/dev-status.svg )] ( https://david-dm.org/quatrocode/react-pretty-json?type=dev )
6+
7+ ## Get started
8+ 1 ) Install ` react-pretty-json ` in your project:
9+ ``` sh
10+ $ npm install react-pretty-json
11+ ```
12+ 2 ) Import package and pass JSON.
13+ ``` typescript
14+ import JsonView from ' react-pretty-json' ;
15+
16+ // ...
17+
18+ render () {
19+ let obj = {
20+ example: ' string' ,
21+ number: 123 ,
22+ boolean: true
23+ };
24+ return <JsonView json ={obj} />;
25+ }
26+
27+ ```
28+
29+ 3 ) (Optional) Importing styles. You can reach it with `react-pretty-json/assets/json-view.css'.
30+ ``` typescript
31+ import ' react/pretty-json/assets/json-view.css!' ;
32+ ```
33+
34+ ## Component props
35+
36+ | Prop | Type | Default | Description |
37+ | ---------| --------| ---------| ----------------------------------------|
38+ | json` * ` | object | none | Generate object. |
39+ | spaces | number | 4 | Parts that will be generated js files. |
40+
41+ ` * ` - Required.
42+
43+ ## License
44+ [ GPL-3.0] ( LICENSE )
You can’t perform that action at this time.
0 commit comments