Gathering detailed insights and metrics for @sishuguojixuefu/react-native-json-tree
Gathering detailed insights and metrics for @sishuguojixuefu/react-native-json-tree
Gathering detailed insights and metrics for @sishuguojixuefu/react-native-json-tree
Gathering detailed insights and metrics for @sishuguojixuefu/react-native-json-tree
React Native JSON Viewer Component, based on react-json-tree
npm install @sishuguojixuefu/react-native-json-tree
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
120 Stars
66 Commits
33 Forks
4 Watchers
15 Branches
12 Contributors
Updated on Feb 24, 2025
Latest Version
1.2.5
Package Id
@sishuguojixuefu/react-native-json-tree@1.2.5
Unpacked Size
28.88 kB
Size
9.02 kB
File Count
17
NPM Version
6.14.6
Node Version
12.16.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
React Native JSON Viewer Component, based on react-json-tree. Supports iterable objects, such as Immutable.js.
1import JSONTree from 'react-native-json-tree' 2// If you're using Immutable.js: `npm i --save immutable` 3import { Map } from 'immutable' 4 5// Inside a React component: 6const json = { 7 array: [1, 2, 3], 8 bool: true, 9 object: { 10 foo: 'bar' 11 } 12 immutable: Map({ key: 'value' }) 13} 14 15<JSONTree data={json} />
Check out the Example directory.
This component now uses react-base16-styling module, which allows to customize component via theme
property, which can be the following:
{ style, className }
and should return an object with the same structure. Other arguments depend on particular context (and should be described here). See createStylingFromTheme.js for the list of styling object keys. Also, this object can extend base16
theme via extend
property.Every theme has a light version, which is enabled with invertTheme
prop.
1const theme = { 2 scheme: 'monokai', 3 author: 'wimer hazenberg (http://www.monokai.nl)', 4 base00: '#272822', 5 base01: '#383830', 6 base02: '#49483e', 7 base03: '#75715e', 8 base04: '#a59f85', 9 base05: '#f8f8f2', 10 base06: '#f5f4f1', 11 base07: '#f9f8f5', 12 base08: '#f92672', 13 base09: '#fd971f', 14 base0A: '#f4bf75', 15 base0B: '#a6e22e', 16 base0C: '#a1efe4', 17 base0D: '#66d9ef', 18 base0E: '#ae81ff', 19 base0F: '#cc6633' 20}; 21 22<JSONTree data={data} theme={theme} invertTheme={false} /> 23
1<JSONTree data={data} theme={{ 2 extend: theme, 3 // underline keys for literal values 4 valueLabel: { 5 textDecoration: 'underline' 6 }, 7 // switch key for objects to uppercase when object is expanded. 8 // `nestedNodeLabel` receives additional arguments `expanded` and `keyPath` 9 nestedNodeLabel: ({ style }, nodeType, expanded) => ({ 10 style: { 11 ...style, 12 textTransform: expanded ? 'uppercase' : style.textTransform 13 } 14 }) 15}} />
You can pass getItemString
to customize the way arrays, objects, and iterable nodes are displayed (optional).
By default, it'll be:
1<JSONTree getItemString={(type, data, itemType, itemString) => 2 <Text>{itemType} {itemString}</Text>} 3/>
But if you pass the following:
1const getItemString = (type, data, itemType, itemString) => 2 <Text>{type}</Text>;
Then the preview of child elements now look like this:
You can pass the following properties to customize rendered labels and values:
1<JSONTree 2 labelRenderer={raw => <Text style={{ fontWeight: 'bold' }}>{raw}</Text>} 3 valueRenderer={raw => <Text style={{ fontStyle: 'italic' }}>{raw}</Text>} 4/>
In this example the label and value will be rendered with bold and italic text respectively.
For labelRenderer
, you can provide a full path - see this PR.
shouldExpandNode: (keyName, data, level) => boolean
- determines if node should be expanded (root is expanded by default)hideRoot: boolean
- if true
, the root node is hidden.sortObjectKeys: boolean | (a, b) => number
- sorts object keys with compare function (optional). Isn't applied to iterable maps like Immutable.Map
.MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 10/21 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
73 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More