Render JSON Data As A Tree View – json-view
Download and import the json-view’s files into the document.
<link rel="stylesheet" href="/path/to/dist/jsonview.bundle.css" />
The library uses Font Awesome for the collapse/expand icons.
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
<script src="/path/to/dist/jsonview.bundle.js"></script>
Create a container to place the JSON viewer.
<div class="root"></div>
Format and render your JSON data in the container.
let data = '{}';
let target = '.root';
jsonView.format(data, target); API methods.
// expand tree
jsonView.expandChildren(tree);
// collapse tree
jsonView.collapseChildren(tree);
// treverse tree object
jsonView.traverseTree(tree, function(node) {
console.log(node);
}); 12/03/2025
03/29/2025
10/17/2023
10/07/2023
07/07/2023
07/05/2022
01/11/2022
05/26/2020
05/26/2020
05/25/2020
05/23/2020
10/09/2019
The post Render JSON Data As A Tree View – json-view appeared first on CSS Script.
In January, Qualcomm hinted to The Verge that it might finally bring its powerful Arm-based…
Students are seen on the campus of Columbia University on April 14, 2025, in New…
If you’ve been waiting to grab any video games, today might be the day. On…
I first took notice of Samson: A Tyndalston Story when its team of former Just…
Stardew Valley creator Eric Barone (ConcernedApe) has released a 10th anniversary video revealing, among other…
Highguard studio Wildlight Entertainment reportedly has less than 20 people remaining to work on the…
This website uses cookies.