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
- JsonTreeViewer - the collapsible view of the same data
- ResourceOpenWith - letting the reader pick between them