Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/constantoduol/jsoneditor

A react visual json editor
https://github.com/constantoduol/jsoneditor

javascript javascript-library json jsoneditor jsonviewer reactjs

Last synced: 5 days ago
JSON representation

A react visual json editor

Awesome Lists containing this project

README

        

### Getting started

`npm i react-json-editor-viewer`

### Easily view json in react

```javascript
import { JSONViewer } from "react-json-editor-viewer";

;
```

![Alt text](images/jsonviewer.png?raw=true "JSON Viewer")

### Make your json viewer collapsible

```javascript
import { JSONViewer } from "react-json-editor-viewer";

;
```

![Alt text](images/jsonviewer_collapse.png?raw=true "JSON Viewer")

### Edit json easily and listen to changes in the data, hover on elements to add/remove keys

```javascript
import {JSONEditor} from 'react-json-editor-viewer';

constructor(){
this.onJsonChange = this.onJsonChange.bind(this);
}

onJsonChange(key, value, parent, data){
console.log(key, value, parent, data);
}

```

![Alt text](images/jsoneditor.png?raw=true "JSON Viewer")

### View both the json editor and viewer side by side

```javascript
import {JSONEditor} from 'react-json-editor-viewer';

constructor(){
this.onJsonChange = this.onJsonChange.bind(this);
}

onJsonChange(key, value, parent, data){
console.log(key, value, parent, data);
}

```

![Alt text](images/jsoneditor_dual.png?raw=true "JSON Viewer")

### Configure your optional custom styles

See the source for the [Demo App](src/demo/App.js)

default

![Alt text](images/jsoneditor_unstyled.png?raw=true "Unstyled JSON Editor")

override custom styles

![Alt text](images/jsoneditor_styled.png?raw=true "Styled JSON Editor")

### License: MIT