Skip to main content

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

name:
Varun Bardwaj
city:
Bengaluru
address
state:
Karnataka
country:
India

Props

nametypemandatorydescription
dataJSONyesdata to print tree
themeobjectnoaccepts bg, fg, size as an object to customize background, color and fontSize respectively
widthstringnowidth of view
heightstringnoheight of view
shadowbooleannoboxShadow of view