New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-json-view

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-json-view

Simple, pure javascript formatted json view in react-native.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

react-native-json-view

Simple, pure JavaScript formatted JSON view component for React Native.

Installation

npm install react-native-json-view

or

yarn add react-native-json-view

Usage

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}
    />
  );
}

Props

PropTypeDefaultDescription
dataunknown-The JSON data to display
themeNameJsonThemeName-Predefined theme name (mutually exclusive with theme)
themeJsonColorTheme-Custom color theme (mutually exclusive with themeName)
collapsedbooleanfalseWhether to collapse all nodes by default
onlyCollapseRootbooleanfalseWhether to only allow collapsing the root node
fontSizenumber14Font size for the JSON text
indentnumber2Number of spaces for indentation

All other ScrollView props are also supported.

Themes

The component comes with several built-in themes:

  • JsonThemeName.Default - Clean default theme
  • JsonThemeName.Monokai - Monokai editor theme
  • JsonThemeName.Solarized - Solarized color scheme
  • JsonThemeName.Github - GitHub's syntax highlighting
  • JsonThemeName.Nord - Nord color palette
  • JsonThemeName.Dracula - Dracula theme
  • JsonThemeName.OneDark - One Dark Pro theme
  • JsonThemeName.Catppuccin - Catppuccin theme
  • JsonThemeName.TokyoNight - Tokyo Night theme

Each theme supports both light and dark variants.

Custom Theme

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} />;

Contributing

  • Development workflow
  • Sending a pull request
  • Code of conduct

License

MIT

Made with create-react-native-library

Keywords

react-native

FAQs

Package last updated on 17 Mar 2026

Did you know?

Socket

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.

Install

Related posts