🌐
GitHub
github.com › Dean177 › react-native-json-tree
GitHub - Dean177/react-native-json-tree: React Native JSON Viewer Component, based on react-json-tree
import JSONTree from 'react-native-json-tree' // If you're using Immutable.js: `npm i --save immutable` import { Map } from 'immutable' // Inside a React component: const json = { array: [1, 2, 3], bool: true, object: { foo: 'bar' } immutable: Map({ key: 'value' }) } <JSONTree data={json} />
Starred by 122 users
Forked by 33 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
npm
npmjs.com › package › react-native-json-tree
react-native-json-tree - npm
import JSONTree from 'react-native-json-tree' // If you're using Immutable.js: `npm i --save immutable` import { Map } from 'immutable' // Inside a React component: const json = { array: [1, 2, 3], bool: true, object: { foo: 'bar' } immutable: Map({ key: 'value' }) } <JSONTree data={json} />
      » npm install react-native-json-tree
    
Published   Feb 04, 2025
Version   1.5.0
Author   Dean Merchant
Discussions

How to push data into array as a JSON tree in react native? - Stack Overflow
I'm developing a mobile app using React Native. I need to put some data into an array with categories (SubKeys / Children). I have data stored in Firebase Real-time Database. So, I want to push those More on stackoverflow.com
🌐 stackoverflow.com
Viewing JSON as a drop down tree using ReactJS - Stack Overflow
I am trying to display the below JSON as a drop down tree. This is passing as a prop to the Tree.js. I need to display the json as a drop down tree with all of its properties and values. I used react- More on stackoverflow.com
🌐 stackoverflow.com
How to create component tree hierarchy from JSON? ReactJS - Stack Overflow
need to use the data value in tree format. It should automatically create a new node if there is another child More on stackoverflow.com
🌐 stackoverflow.com
React Tree View for Json object?
I use this: https://www.npmjs.com/package/react-json-view More on reddit.com
🌐 r/reactjs
1
2
July 1, 2021
🌐
npm
npmjs.com › package › react-json-tree
react-json-tree - npm
March 1, 2025 - import { JSONTree } from 'react-json-tree'; // If you're using Immutable.js: `npm i --save immutable` import { Map } from 'immutable'; // Inside a React component: const json = { array: [1, 2, 3], bool: true, object: { foo: 'bar', }, immutable: Map({ key: 'value' }), }; <JSONTree data={json} />;
      » npm install react-json-tree
    
Published   Mar 01, 2025
Version   0.20.0
Author   Shu Uesugi
🌐
npm
npmjs.com › package › @sishuguojixuefu › react-native-json-tree
@sishuguojixuefu/react-native-json-tree - npm
March 22, 2021 - import JSONTree from 'react-native-json-tree' // If you're using Immutable.js: `npm i --save immutable` import { Map } from 'immutable' // Inside a React component: const json = { array: [1, 2, 3], bool: true, object: { foo: 'bar' } immutable: Map({ key: 'value' }) } <JSONTree data={json} />
      » npm install @sishuguojixuefu/react-native-json-tree
    
Published   Mar 22, 2021
Version   1.2.5
Author   Dean Merchant
🌐
CodeSandbox
codesandbox.io › examples › package › react-json-tree
react-json-tree examples - CodeSandbox
Use this online react-json-tree playground to view and fork react-json-tree example apps and templates on CodeSandbox.
🌐
Stack Overflow
stackoverflow.com › questions › 56052551 › how-to-push-data-into-array-as-a-json-tree-in-react-native
How to push data into array as a JSON tree in react native? - Stack Overflow
I'm developing a mobile app using React Native. I need to put some data into an array with categories (SubKeys / Children). I have data stored in Firebase Real-time Database. So, I want to push those data into an array as that JSON tree exists. For example, I want to build an array like following.
Find elsewhere
🌐
npm
npmjs.com › package › react-editable-json-tree
react-editable-json-tree - npm
October 22, 2022 - // Import import { JsonTree, ADD_DELTA_TYPE, REMOVE_DELTA_TYPE, UPDATE_DELTA_TYPE, DATA_TYPES, INPUT_USAGE_TYPES, } from 'react-editable-json-tree' // Data const data = { error: new Error('error'), text: 'text', int: 100, boolean: true, null: null, object: { text: 'text', int: 100, boolean: true, }, array: [ 1, { string: 'test', }, ], } // Component <JsonTree data={data} />
      » npm install react-editable-json-tree
    
Published   Oct 22, 2022
Version   2.3.0
Author   Oxyno-zeta
🌐
npm
npmjs.com › package › react-json-view-lite
react-json-view-lite - npm
September 6, 2025 - react-json-view-lite is a tiny component for React allowing to render JSON as a tree. It focused on the balance between performance for large JSON inputs and functionality. It might not have all the rich features (suce as customization, copy, ...
      » npm install react-json-view-lite
    
Published   Sep 06, 2025
Version   2.5.0
Author   AnyRoad
🌐
StackBlitz
stackblitz.com › edit › react-json-tree
React Json Tree - StackBlitz
Starter project for React apps that exports to the create-react-app CLI.
🌐
Reddit
reddit.com › r/reactjs › react tree view for json object?
r/reactjs on Reddit: React Tree View for Json object?
July 1, 2021 -

Is there any good tree views for react I can use for creating a view of a large json object?

I found a few but they are a bit over the top. I just need a clean simple tree view.

Top answer
1 of 3
9

Recursion is fun!

const data = [{
  title: "Node 1",
  childNodes: [
    { title: "Childnode 1.1" },
    {
      title: "Childnode 1.2",
      childNodes: [
        {
          title: "Childnode 1.2.1",
          childNodes: [
            { title: "Childnode 1.2.1.1" }
          ]
        }, { title: "Childnode 1.2.2" }
      ]
    }
  ]
}];

const App = () => (
  <form>
    <Tree data={data} />
  </form>
);

const Tree = ({data}) => ( 
  <ul>
    {data && data.map(item => (
      <li>
        {item.title}
        {item.childNodes && <Tree data={item.childNodes} />}
      </li>
    ))}
  </ul>
);

Demo: https://codesandbox.io/s/01kl2xmo40

2 of 3
1

This example below can work on all json objects i have tested it on checkout my github repo: https://github.com/nickjohngray/blockout/blob/master/src/Tree/Tree.tsx the html generated is the same as https://www.w3schools.com/howto/howto_js_treeview.asp

class Tree extends React.Component {

   

    processObject = (object) =>
        Object.keys(object).map((key, reactKey) => {
            return (
                <li key={reactKey + key}>
                    {this.buildNode(key)}
                    <ul className="nested">
                        {this.isPrimative(object[key]) ? this.buildLeaf(object[key]) :
                            this.isArray(object[key]) ? this.loopArray(object[key]) : this.processObject(object[key])}
                    </ul>
                </li>
            )
        })

    loopArray = (array) =>
        array.map((value, key) =>
            <div key={key + value}>
                {this.isPrimative(value) ? this.buildLeaf(value) :
                    this.isArray(value) ? this.loopArray(value) : this.processObject(value)}
            </div>
        )

    isArray = (value) =>
        Array.isArray(value)

    isPrimative = (value) => {
        return typeof (value) === 'string'
            || typeof (value) === 'number'
            || typeof (value) === 'boolean'
    }

    buildNode = (key: string) =>
        <span className="node"
              onClick={
                  (e) => {
                      this.toggle(e)
                  }}>
             {key}
            </span>

    buildLeaf = (value: string) =>
        <li className="leaf"
            onClick={
                (e) => {

                }}>
            {value}
        </li>

    toggle = (event) => {
        event.target.parentElement.querySelector(".nested").classList.toggle("active");
        event.target.classList.toggle("node-down");
    }

    render = () => <>
        <ul id="myUL">
            {this.processObject(json)}
        </ul>
    </>
}

export default Tree;

this is the css for it, copied from wc3 schools

/* Remove default bullets */
ul, #myUL {
    list-style-type: none;
}

body {
    background: red;
}


/* Remove margins and padding from the parent ul */
#myUL {
    margin: 0;
    padding: 0;
}

/* Style the caret/arrow */
.caret {
    cursor: pointer;
    user-select: none; /* Prevent text selection */
    background: red;
}

/* Create the caret/arrow with a unicode, and style it */
.caret::before {
    content: "\25B6";
    color: black;
    display: inline-block;
    margin-right: 6px;
}

/* Rotate the caret/arrow icon when clicked on (using JavaScript) */
.caret-down::before {
    transform: rotate(90deg);
}

/* Hide the nested list */
.nested {
    display: none;
}

/* Show the nested list when the user clicks on the caret/arrow (with JavaScript) */
.active {
    display: block;
}
🌐
ReactScript
reactscript.com › home › categories › text › react native json viewer component
React Native JSON Viewer Component | Reactscript
January 15, 2024 - React Native JSON Viewer Component, based on react-json-tree. Supports iterable objects, such as Immutable.js.
🌐
CodeSandbox
codesandbox.io › examples › package › react-native-json-tree
react-native-json-tree examples - CodeSandbox
Use this online react-native-json-tree playground to view and fork react-native-json-tree example apps and templates on CodeSandbox.
🌐
Stack Overflow
stackoverflow.com › questions › 55761212 › recursive-parse-json-tree-in-react-native
Recursive parse JSON tree in react native
April 19, 2019 - I'm trying to display the comments of reddit posts using react native. Since the returned JSON from the API is always a nested number of comments I guess the best way to parse the JSON is to use recursion. To get the comments for a post in a subreddit the following url can be use and I've linked an example. https://www.reddit.com/r/${subreddit}/comments/${postId}.json · Next step I'm using a recursive function to move through the JSON tree and find any object that has a body property and push it in to an array.