Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-simple-json-viewer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-json-viewer

A basic lightweight React component for viewing data in an expandable way.

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
77
decreased by-57.69%
Maintainers
1
Weekly downloads
 
Created
Source

react-simple-json-viewer

A basic lightweight React (jsx) component for viewing data in an expandable way.

null screenshot

DEMO

Usage

npm install react-simple-json-viewer

Then inside some react component:

import JSONViewer from 'react-simple-json-viewer'

// Place your component as needed
<JSONViewer data={myData}/>

The data prop passed in can be any object, array, or value.

Styling

This library utilises Emotion's css function to generate top level classes for styling. If you look at index.js in /src you will see the default minimal styles applied to the container and children. To override the default styling just use the css prop when using the component. For example, to change the color of the values:

<JSONViewer data={data} css={{
  'span.rsjv-value': {
    color: 'purple'
  }
}}>

SSR

As the library depends on a recent version of emotion, SSR should work out of the box. However depending on your SSR setup, you may need to do something more complicated, in which case please refer to the Emotion SSR docs.

Credits

This library was built @wethrift by @matt-way

Keywords

FAQs

Package last updated on 06 Mar 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc