JSONFormatter

Render JSON objects in HTML with a collapsible navigation.

JSON Formatter project on GitHub

Usage

Simple usage in ES6

import JSONFormatter from 'json-formatter-js'

const myJSON = {ans: 42};

const formatter = new JSONFormatter(myJSON);

document.body.appendChild(formatter.render());
  

Playground

Updating the JSON value in this textarea renders a new formatter on the right.

Examples