
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-json-view
Advanced tools
Simple, pure JavaScript formatted JSON view component for React Native.
npm install react-native-json-view
or
yarn add react-native-json-view
import JsonView, { JsonThemeName } from 'react-native-json-view';
const sampleData = {
name: 'John Doe',
age: 30,
active: true,
hobbies: ['reading', 'coding'],
address: {
street: '123 Main St',
city: 'Anytown',
zip: '12345',
},
};
export default function App() {
return (
<JsonView
data={sampleData}
themeName={JsonThemeName.Default}
fontSize={16}
/>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
data | unknown | - | The JSON data to display |
themeName | JsonThemeName | - | Predefined theme name (mutually exclusive with theme) |
theme | JsonColorTheme | - | Custom color theme (mutually exclusive with themeName) |
collapsed | boolean | false | Whether to collapse all nodes by default |
onlyCollapseRoot | boolean | false | Whether to only allow collapsing the root node |
fontSize | number | 14 | Font size for the JSON text |
indent | number | 2 | Number of spaces for indentation |
All other ScrollView props are also supported.
The component comes with several built-in themes:
JsonThemeName.Default - Clean default themeJsonThemeName.Monokai - Monokai editor themeJsonThemeName.Solarized - Solarized color schemeJsonThemeName.Github - GitHub's syntax highlightingJsonThemeName.Nord - Nord color paletteJsonThemeName.Dracula - Dracula themeJsonThemeName.OneDark - One Dark Pro themeJsonThemeName.Catppuccin - Catppuccin themeJsonThemeName.TokyoNight - Tokyo Night themeEach theme supports both light and dark variants.
You can also provide a custom theme:
const customTheme = {
light: {
null: '#ff0000',
boolean: '#00ff00',
number: '#0000ff',
string: '#ff00ff',
key: '#00ffff',
bracket: '#888888',
meta: '#aaaaaa',
undefined: '#cccccc',
background: '#ffffff',
},
dark: {
// ... dark variant
},
};
<JsonView data={data} theme={customTheme} />;
MIT
Made with create-react-native-library
FAQs
Simple, pure javascript formatted json view in react-native.
We found that react-native-json-view demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.