Skip to content

Commit 8f134d6

Browse files
author
Martynas Žilinskas
committed
Updated readme.
1 parent 5349e1f commit 8f134d6

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

readme.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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)

0 commit comments

Comments
 (0)