react-json-tree-viewer

0.0.7 • Public • Published

react-json-tree-viewer

Build Status

react-json-tree-viewer

Usage

import Rjv from 'react-json-tree-viewer'
 
const json = {
  array: [1, 2, 3],
  bool: true,
  object: {
    foo: 'bar'
  }
}
 
<Rjv data={json} />

Result

Props

Name Type Default Description
data object/array {} json data
hideRoot boolean false if show root
shouldExpandNode (path: string[], data: any) => boolean null if expand object or array in first render
onArrowClick (path: string[], expanded: boolean) => void null hanle arrow click
labelRenderer (keyName: string) => JSX.Element null custom render label
valueRenderer (data: any) => JSX.Element null custom render value
typeRenderer (data: any) => JSX.Element null custom type laber
arrowStyle React css Properties null custom arrow style

Package Sidebar

Install

npm i react-json-tree-viewer

Weekly Downloads

60

Version

0.0.7

License

MIT

Unpacked Size

48.2 kB

Total Files

24

Last publish

Collaborators

  • shenshuaijia