1.0.1 • Published 4 years ago

react-basic-json v1.0.1

Weekly downloads
11
License
-
Repository
github
Last release
4 years ago

React-basic-JSON npm version

A basic JSON Viewer component built for React.

basic-json-gif

Install

npm install react-basic-json

Usage

import { BasicJSON } from 'react-basic-json'
const json = {
    make: 'Ford',
    model: 'Mustang',
    year: 1969,
    message: {
        mid: 'mid.1457764197618:41d102a3e1ae206a38',
        seq: 73
    }
};
<BasicJSON data={json}/>

You can also pass a string representing a JSON as the data property. Example:

const json ='{"make":"Ford","model":"Mustang","year":1969,"message":{"mid":"mid.1457764197618:41d102a3e1ae206a38","seq":73}}'
<BasicJSON data={json}/>

Styling

The CSS file Collapsible.css is commented and easy to be customized. Feel free to make changes.

License

MIT