Skip to content

Commit b7f742a

Browse files
authored
fix(README): add usage
1 parent 0c2a4de commit b7f742a

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,47 @@
22

33
A react component to visually display JSON Schemas
44

5+
56
![image](https://user-images.githubusercontent.com/364566/78064105-14144880-7346-11ea-9b42-b7158048cba9.png)
67

8+
9+
## Usage
10+
`npm install @xops.net/json-schema-to-react-tree`
11+
12+
```
13+
import React from "react";
14+
import JSONSchemaTree from "@xops.net/json-schema-to-react-tree";
15+
16+
const MyApp = (props) => {
17+
return (
18+
<>
19+
<JSONSchemaTree
20+
schema={{
21+
type: "object",
22+
properties: {
23+
number: {
24+
type: "string",
25+
},
26+
hash: {
27+
type: "string",
28+
},
29+
timestamp: {
30+
description: "timestamp in which the block occured",
31+
title: "Timestamp",
32+
type: "string",
33+
},
34+
transactions: {
35+
type: "string",
36+
},
37+
},
38+
}} />
39+
</>
40+
)
41+
}
42+
export default MyApp;
43+
```
44+
45+
746
### Contributing
847

948
How to contribute, build and release are outlined in [CONTRIBUTING.md](CONTRIBUTING.md), [BUILDING.md](BUILDING.md) and [RELEASING.md](RELEASING.md) respectively. Commits in this repository follow the [CONVENTIONAL_COMMITS.md](CONVENTIONAL_COMMITS.md) specification.

0 commit comments

Comments
 (0)