JsonView
JsonView accepts data prop and displays a JSON tree.
Example
Data
const data = {
name: "Varun Bardwaj",
city: "Bengaluru",
address: {
address_line_1: "random line 1",
address_line_2: "random line 2",
landmark: "random landmark",
},
city: "Bengaluru",
state: "Karnataka",
country: "India",
};
Component
Pass data variable to prop data
<JsonView data={data} />
Output
Props
name | type | mandatory | description |
---|---|---|---|
data | JSON | yes | data to print tree |
theme | object | no | accepts bg, fg, size as an object to customize background, color and fontSize respectively |
width | string | no | width of view |
height | string | no | height of view |
shadow | boolean | no | boxShadow of view |