JsonViewer

JSON as highlighted text.

import { JsonViewer } from '@textui/documents';

<JsonViewer content={'{ "ok": true }'} />

Props

| Prop | Type | Default | | | — | — | — | — | | resource | Resource | | | | uri | string | | | | content | string | | | | lineNumbers | boolean | true | |

Plus everything on BoxProps.

Role: document.

Ships with the JSON adapter rather than with the core catalog, so it is registered when that adapter is - which is why it and JsonTreeViewer are in @textui/documents.

Text is the right default: it preserves key order and formatting, and a diff of it is readable.

See also


Back to top

MIT licensed. Pre-1.0 - the surface is still moving.