<pretty-json> HTML Custom Element

<pretty-json> is an HTML custom element that allows you to render JSON objects in HTML documents with human-readable formatting and expandable interaction for browsing deep JSON structures.

Usage

Include pretty-json-custom-element/index.js in your HTML page and use the HTML custom element as follows:

<script defer src="https://unpkg.com/pretty-json-custom-element/index.js"></script>
<pretty-json>
  {
    "hello": "world",
    "array": [1, 2, 3],
    "object": {
      "key": "value"
    }
  }
</pretty-json>

Results into:

{ "hello": "world", "array": [1, 2, 3], "object": { "key": "value" } }

Documentation

Read the full documentation on GitHub.