@chinanetcloud/react-nested-json-table

A simple React component that renders any deeply nested json into a collapsible table

Usage no npm install needed!

<script type="module">
  import chinanetcloudReactNestedJsonTable from 'https://cdn.skypack.dev/@chinanetcloud/react-nested-json-table';
</script>

README

react-nested-json-table

A simple React component that renders any deeply nested json into a collapsible table

Install
npm install react-nested-json-table
Turn this deeply nested json:
[
  { "foo": 'bar' }, 
  { 
    "nested": { "nested-arr": [
      { "simple": "object" }, 
      { "another-simple": "object" }, 
      { "arr": ["1", 2, { "variant": "3" }] } ] } 
  }, 
  { 
    "attr0": 6789, 
    "attr1": [{"key-0": "foo", "key-1": "bar"}], 
    "attr2": ["mem-0", "mem-1"]
  }
]
Into this:

react-nested-json-table

Since version 0.2.x

Set expandAll={true} to expand all nodes on initial render expand-all