Most JSON viewers are made for developers. They show the data exactly as it is: raw keys like created_at, null, true, deeply nested arrays. That's great for debugging. It's less great when the people looking at the page are support agents, managers or customers.

The idea came from a real project: we needed to show API responses on a page for people who never read raw JSON. A tree of created_at: null and is_active: true wasn't helpful to them. They needed readable labels, without the technical noise, and lists shown as proper tables.

So I wrote json-custom-view: a small library that renders JSON in the browser as a collapsible tree or as tables, and lets you decide how it looks through settings. Any array of objects can be drawn as a real table, so a list of orders or users reads like a spreadsheet instead of a stack of nested nodes.

What it does

import { generate } from 'json-custom-view'; generate(data, document.querySelector('#view'), { root: 'order.items', // show only this part of the JSON isFormatKeys: true, // createdAt -> Created at hidePropertiesByKey: ['id'], // hide technical fields nullAppearence: '—', // null -> — boolAppearence: ['Yes', 'No'], // true/false -> Yes/No arraysAsTable: ['items'], // arrays of objects as tables }); 

The other settings:

  • hidePropertiesByValue hides fields with certain values;
  • hideEmpty hides empty objects and arrays, including those that became empty after hiding;
  • isMergeSingleFields merges an object or array with a single item into its parent;
  • keysForArrays uses a field (say, city) as the label of each array element instead of 0, 1, 2.

There's also transform(data, settings), which applies the same settings and returns the result as an object, if you want to render it yourself.

A few things I cared about

  • No runtime dependencies. The package is plain TypeScript compiled to JS.
  • Types included. Settings, the result and errors are typed.
  • It doesn't throw on bad input. generate returns { isRendered, errors }, and every error has a type: data (the JSON itself is broken), settings, usage or internal. So the app can tell "ask the user for another file" from "fix the settings form" without parsing messages.
  • Keyboard navigation. Keys can be focused with Tab; arrow keys move between them and open or close nodes, only while focus is inside the view.
  • React wrapper. @json-custom-view/react is a thin component around the same core:
import { JsonCustomView } from '@json-custom-view/react'; <JsonCustomView data={data} settings={settings} /> 

How it compares

  • react-json-view and its forks, @uiw/react-json-view, react18-json-view: React-only developer tools with syntax colors, copy buttons and sometimes editing. Pick them for debugging views.
  • json-formatter-js, renderjson: small vanilla viewers with no dependencies, also aimed at developers. They show the data as it is; they don't hide, rename or reformat.
  • vanilla-jsoneditor (josdejong): a full editor with tree, text and table modes. Much more powerful, much bigger. Pick it if users need to edit.
  • json-custom-view: read-only, small, and focused on presenting data: hiding noise, readable keys, tables for lists.

What it doesn't do: editing, search, syntax-highlighted raw view, or virtualization for very large files.

Try it

It's a side project that I maintain in my free time. Bug reports and ideas are welcome in the issues, and I'd love to hear what you'd use it for.