JSON Viewer

Alpha

JSON Viewer renders JavaScript data as an expandable, collapsible tree with syntax-colored values.

import {JsonViewer} from "@qualcomm-ui/react/json-viewer"

Examples

Interactive

Select a .json file with File Input to view its contents as a tree. Invalid JSON displays an error. Clear the selected file to reset the viewer.

This example is intended for smaller JSON files, typically under 100 KB. The lazyMount option reduces initial rendering work for larger files by deferring branch content until expansion. Expanding all nodes programmatically renders the entire tree and can reduce responsiveness for large datasets.

Select a JSON file
<div className="flex w-full min-w-0 flex-col gap-4">
  <FileInput
    accept=".json"
    className="w-full max-w-sm"
    disabled={reading}
    errorText={error}
    invalid={!!error}
    label="JSON File"
    onFileChange={onFileChange}
    placeholder="Select a JSON file"
  />

  {result ? (
    <div className="max-h-96 overflow-auto">
      <JsonViewer
        data={result.data}
        defaultExpandedDepth={1}
        lazyMount
        unmountOnExit
      />
    </div>
  ) : reading ? (
    <p aria-live="polite" className="text-neutral-secondary font-body-sm">
      Reading JSON file…
    </p>
  ) : null}
</div>

Simple

Pass any JavaScript value to data. Use defaultExpandedDepth to control how many levels are expanded initially.

<JsonViewer
  collapseStringsAfterLength={50}
  data={data}
  defaultExpandedDepth={0}
  maxPreviewItems={7}
  quotesOnKeys
/>

Data Types

The viewer renders values with type-specific coloring for strings, numbers, booleans, null, undefined, dates, regex, and more.

{ array: Array(3), boolean: true, float: 3.14159, … }
array: (3) [ 1, "two", false ]
0: 1
1: "two"
2: false
length: 3
boolean: true
float: 3.14159
nested: { date: Wed Jan 01 2025 00:00:00 GMT+0000 (Coordinated Universal Time), regex: /[a-z]+/gi, symbol: Symbol(example) }
date: 2025-01-01T00:00:00.000Z
symbol: Symbol(example)
null: null
number: 42
string: "hello world"
undefined: undefined
<JsonViewer data={data} defaultExpandedDepth={2} />

Root Provider

Use useJsonViewer with JsonViewer.RootProvider to control expansion through expandedValue and onExpandedValueChange. Call collection.getBranchValues() to expand all branches, or set expandedValue to an empty array to collapse them.

{ founded: 1985, name: "Qualcomm", products: Object, … }
founded: 1985
name: "Qualcomm"
public: true
1 of 4 branches expanded
<JsonViewer.RootProvider
  expandedValue={expanded}
  onExpandedValueChange={({expandedValue}) => setExpanded(expandedValue)}
  value={viewer}
>
  <JsonViewer.Tree arrow={ChevronRight} indentGuide />
</JsonViewer.RootProvider>

Complex Types

Maps, Sets, Headers, URLSearchParams, URLs, Errors, and functions are all supported.

{ binary: ArrayBuffer(16), booleanStack: Object, callback: ƒ onUpdate(), … }
binary: ArrayBuffer(16)
booleanStack: { stack: false }
stack: false
callback: ƒ onUpdate()
name: "onUpdate"
length: 0
constructor: "Function"
[[Function]]: "function onUpdate() {}"
dateMap: Map(2) { "valid" => 2025-01-01T00:00:00.000Z, "invalid" => Invalid Date }
size: 2
dateSet: Set(2) { 2025-01-01T00:00:00.000Z, Invalid Date }
size: 2
errors: (2) [ Error: Connection timeout, TypeError: Expected string, received number ]
length: 2
invalidDate: Invalid Date
metadata: { endpoint: URL, headers: Headers, params: URLSearchParams }
nullConstructor: { constructor: null, name: "value" }
constructor: null
name: "value"
nullPrototype: { name: "value" }
name: "value"
numericStack: { stack: 42 }
stack: 42
tags: Set(4) { "typescript", "react", "design-system", … }
size: 4
typedArray: Uint8Array(2) [ 1, 2 ]
length: 2
byteLength: 2
byteOffset: 0
buffer: ArrayBuffer(2)
users: Map(3) { "alice" => Object, "bob" => Object, "charlie" => Object }
size: 3
<div className="flex w-full flex-col gap-3">
  <Switch
    checked={showExpandedBrackets}
    label="Show expanded brackets"
    onCheckedChange={setShowExpandedBrackets}
  />
  <JsonViewer
    data={data}
    defaultExpandedDepth={2}
    showExpandedBrackets={showExpandedBrackets}
  />
</div>

API

<JsonViewer>

The simple JSON viewer extends the JsonViewer.Root component with the following props:

PropType
Icon used for the branch expand/collapse trigger.
| LucideIcon
| ReactNode
Whether to render vertical indent guide lines for nested levels.
boolean
Props forwarded to the inner JsonViewer.Tree element.
Type
| LucideIcon
| ReactNode
Description
Icon used for the branch expand/collapse trigger.
Type
boolean
Description
Whether to render vertical indent guide lines for nested levels.
Description
Props forwarded to the inner JsonViewer.Tree element.

Composite API

<JsonViewer.Root>

PropTypeDefault
The data to display in the JSON viewer. Accepts any JavaScript value.
unknown
The controlled checked node value
string[]
Truncates string values longer than this character count in the preview.
number
30
The initial checked node value when rendered. Use when you don't need to control the checked node value.
string[]
Expands branches up to this depth initially, without requiring explicit node IDs in defaultExpandedValue.

Ignored when
defaultExpandedValue is provided.
number
0
The initial expanded node ids when rendered. Use when you don't need to control the expanded node value.
string[]
The initial focused node value when rendered. Use when you don't need to control the focused node value.
string | null
The initial selected node value when rendered. Use when you don't need to control the selected node value.
string[]
The document's text/writing direction.
'ltr' | 'rtl'
'ltr'
The controlled expanded node ids
string[]
Whether clicking on a branch should open it or not
boolean
true
The value of the focused node
string | null
A root node to correctly resolve document in custom environments. i.e., Iframes, Electron.
() =>
| ShadowRoot
| Document
| Node
Groups array entries into chunks when the array length exceeds this value. Use a positive integer, or 0 to disable grouping. Invalid values default to 100.
number
100
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
string
When true, the component will not be rendered in the DOM until it becomes visible or active.
boolean
false
Function to load children for a node asynchronously. When provided, branches will wait for this promise to resolve before expanding.
(details: {
indexPath: number[]
node: JsonNode
signal: AbortSignal
valuePath: string[]
}) => Promise<Array<JsonNode>>
Maximum number of items shown in a collapsed container preview.
number
3
Called when the checked value changes
(details: {
checkedNodes: Array<JsonNode>
checkedValue: string[]
}) => void
Called when the tree is opened or closed
(details: {
expandedNodes: Array<JsonNode>
expandedValue: string[]
focusedValue: string | null
}) => void
Called when the focused node changes
(details: {
focusedNode: JsonNode | null
focusedValue: string | null
}) => void
Called when a node finishes loading children
(details: {
collection: TreeCollection<JsonNode>
}) => void
Called when loading children fails for one or more nodes
(details: {
nodes: Array<{
error: Error
indexPath: number[]
node: JsonNode
valuePath: string[]
}>
}) => void
Called when the selection changes
(details: {
focusedValue: string | null
selectedNodes: Array<JsonNode>
selectedValue: string[]
}) => void
Whether to wrap property keys in double quotes.
boolean
false
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The controlled selected node value
string[]
Whether the tree supports multiple selection
  • 'single': only one node can be selected
  • 'multiple': multiple nodes can be selected
| 'single'
| 'multiple'
'single'
Callback function that determines whether a node should be hidden.
(
state: NodeState<T>,
) => boolean | undefined
Whether to show opening and closing brackets around expanded branches. Does not affect collapsed previews.
boolean
true
Whether to display non-enumerable properties (e.g. prototype methods).
boolean
true
The size of the tree and its elements. Governs properties like font size, item padding, and icon sizes.
'sm' | 'md'
'md'
Whether the tree supports typeahead search
boolean
true
When true, the component will be completely removed from the DOM when it becomes inactive or hidden, rather than just being hidden with CSS.
boolean
false
Type
unknown
Description
The data to display in the JSON viewer. Accepts any JavaScript value.
Type
string[]
Description
The controlled checked node value
Type
number
Description
Truncates string values longer than this character count in the preview.
Type
string[]
Description
The initial checked node value when rendered. Use when you don't need to control the checked node value.
Type
number
Description
Expands branches up to this depth initially, without requiring explicit node IDs in defaultExpandedValue.

Ignored when
defaultExpandedValue is provided.
Type
string[]
Description
The initial expanded node ids when rendered. Use when you don't need to control the expanded node value.
Type
string | null
Description
The initial focused node value when rendered. Use when you don't need to control the focused node value.
Type
string[]
Description
The initial selected node value when rendered. Use when you don't need to control the selected node value.
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
string[]
Description
The controlled expanded node ids
Type
boolean
Description
Whether clicking on a branch should open it or not
Type
string | null
Description
The value of the focused node
Type
() =>
| ShadowRoot
| Document
| Node
Description
A root node to correctly resolve document in custom environments. i.e., Iframes, Electron.
Type
number
Description
Groups array entries into chunks when the array length exceeds this value. Use a positive integer, or 0 to disable grouping. Invalid values default to 100.
Type
string
Description
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
Type
boolean
Description
When true, the component will not be rendered in the DOM until it becomes visible or active.
Type
(details: {
indexPath: number[]
node: JsonNode
signal: AbortSignal
valuePath: string[]
}) => Promise<Array<JsonNode>>
Description
Function to load children for a node asynchronously. When provided, branches will wait for this promise to resolve before expanding.
Type
number
Description
Maximum number of items shown in a collapsed container preview.
Type
(details: {
checkedNodes: Array<JsonNode>
checkedValue: string[]
}) => void
Description
Called when the checked value changes
Type
(details: {
expandedNodes: Array<JsonNode>
expandedValue: string[]
focusedValue: string | null
}) => void
Description
Called when the tree is opened or closed
Type
(details: {
focusedNode: JsonNode | null
focusedValue: string | null
}) => void
Description
Called when the focused node changes
Type
(details: {
collection: TreeCollection<JsonNode>
}) => void
Description
Called when a node finishes loading children
Type
(details: {
nodes: Array<{
error: Error
indexPath: number[]
node: JsonNode
valuePath: string[]
}>
}) => void
Description
Called when loading children fails for one or more nodes
Type
(details: {
focusedValue: string | null
selectedNodes: Array<JsonNode>
selectedValue: string[]
}) => void
Description
Called when the selection changes
Type
boolean
Description
Whether to wrap property keys in double quotes.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
string[]
Description
The controlled selected node value
Type
| 'single'
| 'multiple'
Description
Whether the tree supports multiple selection
  • 'single': only one node can be selected
  • 'multiple': multiple nodes can be selected
Type
(
state: NodeState<T>,
) => boolean | undefined
Description
Callback function that determines whether a node should be hidden.
Type
boolean
Description
Whether to show opening and closing brackets around expanded branches. Does not affect collapsed previews.
Type
boolean
Description
Whether to display non-enumerable properties (e.g. prototype methods).
Type
'sm' | 'md'
Description
The size of the tree and its elements. Governs properties like font size, item padding, and icon sizes.
Type
boolean
Description
Whether the tree supports typeahead search
Type
boolean
Description
When true, the component will be completely removed from the DOM when it becomes inactive or hidden, rather than just being hidden with CSS.

<JsonViewer.RootProvider>

PropTypeDefault
Pre-computed state from useJsonViewer. Use this when you need to access the viewer state outside the component tree.
UseJsonViewerReturn
The controlled checked node value
string[]
The initial checked node value when rendered. Use when you don't need to control the checked node value.
string[]
The initial expanded node ids when rendered. Use when you don't need to control the expanded node value.
string[]
The initial focused node value when rendered. Use when you don't need to control the focused node value.
string | null
The initial selected node value when rendered. Use when you don't need to control the selected node value.
string[]
The document's text/writing direction.
'ltr' | 'rtl'
'ltr'
The controlled expanded node ids
string[]
Whether clicking on a branch should open it or not
boolean
true
The value of the focused node
string | null
A root node to correctly resolve document in custom environments. i.e., Iframes, Electron.
() =>
| ShadowRoot
| Document
| Node
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
string
When true, the component will not be rendered in the DOM until it becomes visible or active.
boolean
false
Function to load children for a node asynchronously. When provided, branches will wait for this promise to resolve before expanding.
(details: {
indexPath: number[]
node: JsonNode
signal: AbortSignal
valuePath: string[]
}) => Promise<Array<JsonNode>>
Called when the checked value changes
(details: {
checkedNodes: Array<JsonNode>
checkedValue: string[]
}) => void
Called when the tree is opened or closed
(details: {
expandedNodes: Array<JsonNode>
expandedValue: string[]
focusedValue: string | null
}) => void
Called when the focused node changes
(details: {
focusedNode: JsonNode | null
focusedValue: string | null
}) => void
Called when a node finishes loading children
(details: {
collection: TreeCollection<JsonNode>
}) => void
Called when loading children fails for one or more nodes
(details: {
nodes: Array<{
error: Error
indexPath: number[]
node: JsonNode
valuePath: string[]
}>
}) => void
Called when the selection changes
(details: {
focusedValue: string | null
selectedNodes: Array<JsonNode>
selectedValue: string[]
}) => void
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The controlled selected node value
string[]
Whether the tree supports multiple selection
  • 'single': only one node can be selected
  • 'multiple': multiple nodes can be selected
| 'single'
| 'multiple'
'single'
Callback function that determines whether a node should be hidden.
(
state: NodeState<T>,
) => boolean | undefined
The size of the tree and its elements. Governs properties like font size, item padding, and icon sizes.
'sm' | 'md'
'md'
Whether the tree supports typeahead search
boolean
true
When true, the component will be completely removed from the DOM when it becomes inactive or hidden, rather than just being hidden with CSS.
boolean
false
Type
UseJsonViewerReturn
Description
Pre-computed state from useJsonViewer. Use this when you need to access the viewer state outside the component tree.
Type
string[]
Description
The controlled checked node value
Type
string[]
Description
The initial checked node value when rendered. Use when you don't need to control the checked node value.
Type
string[]
Description
The initial expanded node ids when rendered. Use when you don't need to control the expanded node value.
Type
string | null
Description
The initial focused node value when rendered. Use when you don't need to control the focused node value.
Type
string[]
Description
The initial selected node value when rendered. Use when you don't need to control the selected node value.
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
string[]
Description
The controlled expanded node ids
Type
boolean
Description
Whether clicking on a branch should open it or not
Type
string | null
Description
The value of the focused node
Type
() =>
| ShadowRoot
| Document
| Node
Description
A root node to correctly resolve document in custom environments. i.e., Iframes, Electron.
Type
string
Description
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
Type
boolean
Description
When true, the component will not be rendered in the DOM until it becomes visible or active.
Type
(details: {
indexPath: number[]
node: JsonNode
signal: AbortSignal
valuePath: string[]
}) => Promise<Array<JsonNode>>
Description
Function to load children for a node asynchronously. When provided, branches will wait for this promise to resolve before expanding.
Type
(details: {
checkedNodes: Array<JsonNode>
checkedValue: string[]
}) => void
Description
Called when the checked value changes
Type
(details: {
expandedNodes: Array<JsonNode>
expandedValue: string[]
focusedValue: string | null
}) => void
Description
Called when the tree is opened or closed
Type
(details: {
focusedNode: JsonNode | null
focusedValue: string | null
}) => void
Description
Called when the focused node changes
Type
(details: {
collection: TreeCollection<JsonNode>
}) => void
Description
Called when a node finishes loading children
Type
(details: {
nodes: Array<{
error: Error
indexPath: number[]
node: JsonNode
valuePath: string[]
}>
}) => void
Description
Called when loading children fails for one or more nodes
Type
(details: {
focusedValue: string | null
selectedNodes: Array<JsonNode>
selectedValue: string[]
}) => void
Description
Called when the selection changes
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
string[]
Description
The controlled selected node value
Type
| 'single'
| 'multiple'
Description
Whether the tree supports multiple selection
  • 'single': only one node can be selected
  • 'multiple': multiple nodes can be selected
Type
(
state: NodeState<T>,
) => boolean | undefined
Description
Callback function that determines whether a node should be hidden.
Type
'sm' | 'md'
Description
The size of the tree and its elements. Governs properties like font size, item padding, and icon sizes.
Type
boolean
Description
Whether the tree supports typeahead search
Type
boolean
Description
When true, the component will be completely removed from the DOM when it becomes inactive or hidden, rather than just being hidden with CSS.

<JsonViewer.Tree>

PropType
Icon used for the branch expand/collapse trigger.
| LucideIcon
| ReactNode
Whether to render vertical indent guide lines for nested levels.
boolean
Custom render function for value nodes.
(
node: JsonNodeHastElement,
) => ReactNode
Type
| LucideIcon
| ReactNode
Description
Icon used for the branch expand/collapse trigger.
Type
boolean
Description
Whether to render vertical indent guide lines for nested levels.
Type
(
node: JsonNodeHastElement,
) => ReactNode
Description
Custom render function for value nodes.

useJsonViewer

PropTypeDefault
The data to display in the JSON viewer. Accepts any JavaScript value.
unknown
The controlled checked node value
string[]
Truncates string values longer than this character count in the preview.
number
30
The initial checked node value when rendered. Use when you don't need to control the checked node value.
string[]
Expands branches up to this depth initially, without requiring explicit node IDs in defaultExpandedValue.

Ignored when
defaultExpandedValue is provided.
number
0
The initial expanded node ids when rendered. Use when you don't need to control the expanded node value.
string[]
The initial focused node value when rendered. Use when you don't need to control the focused node value.
string | null
The initial selected node value when rendered. Use when you don't need to control the selected node value.
string[]
The document's text/writing direction.
'ltr' | 'rtl'
'ltr'
The controlled expanded node ids
string[]
Whether clicking on a branch should open it or not
boolean
true
The value of the focused node
string | null
A root node to correctly resolve document in custom environments. i.e., Iframes, Electron.
() =>
| ShadowRoot
| Document
| Node
Groups array entries into chunks when the array length exceeds this value. Use a positive integer, or 0 to disable grouping. Invalid values default to 100.
number
100
When true, the component will not be rendered in the DOM until it becomes visible or active.
boolean
false
Function to load children for a node asynchronously. When provided, branches will wait for this promise to resolve before expanding.
(details: {
indexPath: number[]
node: JsonNode
signal: AbortSignal
valuePath: string[]
}) => Promise<Array<JsonNode>>
Maximum number of items shown in a collapsed container preview.
number
3
Called when the checked value changes
(details: {
checkedNodes: Array<JsonNode>
checkedValue: string[]
}) => void
Called when the tree is opened or closed
(details: {
expandedNodes: Array<JsonNode>
expandedValue: string[]
focusedValue: string | null
}) => void
Called when the focused node changes
(details: {
focusedNode: JsonNode | null
focusedValue: string | null
}) => void
Called when a node finishes loading children
(details: {
collection: TreeCollection<JsonNode>
}) => void
Called when loading children fails for one or more nodes
(details: {
nodes: Array<{
error: Error
indexPath: number[]
node: JsonNode
valuePath: string[]
}>
}) => void
Called when the selection changes
(details: {
focusedValue: string | null
selectedNodes: Array<JsonNode>
selectedValue: string[]
}) => void
Whether to wrap property keys in double quotes.
boolean
false
The controlled selected node value
string[]
Whether the tree supports multiple selection
  • 'single': only one node can be selected
  • 'multiple': multiple nodes can be selected
| 'single'
| 'multiple'
'single'
Callback function that determines whether a node should be hidden.
(
state: NodeState<T>,
) => boolean | undefined
Whether to show opening and closing brackets around expanded branches. Does not affect collapsed previews.
boolean
true
Whether to display non-enumerable properties (e.g. prototype methods).
boolean
true
Whether the tree supports typeahead search
boolean
true
When true, the component will be completely removed from the DOM when it becomes inactive or hidden, rather than just being hidden with CSS.
boolean
false
Type
unknown
Description
The data to display in the JSON viewer. Accepts any JavaScript value.
Type
string[]
Description
The controlled checked node value
Type
number
Description
Truncates string values longer than this character count in the preview.
Type
string[]
Description
The initial checked node value when rendered. Use when you don't need to control the checked node value.
Type
number
Description
Expands branches up to this depth initially, without requiring explicit node IDs in defaultExpandedValue.

Ignored when
defaultExpandedValue is provided.
Type
string[]
Description
The initial expanded node ids when rendered. Use when you don't need to control the expanded node value.
Type
string | null
Description
The initial focused node value when rendered. Use when you don't need to control the focused node value.
Type
string[]
Description
The initial selected node value when rendered. Use when you don't need to control the selected node value.
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
string[]
Description
The controlled expanded node ids
Type
boolean
Description
Whether clicking on a branch should open it or not
Type
string | null
Description
The value of the focused node
Type
() =>
| ShadowRoot
| Document
| Node
Description
A root node to correctly resolve document in custom environments. i.e., Iframes, Electron.
Type
number
Description
Groups array entries into chunks when the array length exceeds this value. Use a positive integer, or 0 to disable grouping. Invalid values default to 100.
Type
boolean
Description
When true, the component will not be rendered in the DOM until it becomes visible or active.
Type
(details: {
indexPath: number[]
node: JsonNode
signal: AbortSignal
valuePath: string[]
}) => Promise<Array<JsonNode>>
Description
Function to load children for a node asynchronously. When provided, branches will wait for this promise to resolve before expanding.
Type
number
Description
Maximum number of items shown in a collapsed container preview.
Type
(details: {
checkedNodes: Array<JsonNode>
checkedValue: string[]
}) => void
Description
Called when the checked value changes
Type
(details: {
expandedNodes: Array<JsonNode>
expandedValue: string[]
focusedValue: string | null
}) => void
Description
Called when the tree is opened or closed
Type
(details: {
focusedNode: JsonNode | null
focusedValue: string | null
}) => void
Description
Called when the focused node changes
Type
(details: {
collection: TreeCollection<JsonNode>
}) => void
Description
Called when a node finishes loading children
Type
(details: {
nodes: Array<{
error: Error
indexPath: number[]
node: JsonNode
valuePath: string[]
}>
}) => void
Description
Called when loading children fails for one or more nodes
Type
(details: {
focusedValue: string | null
selectedNodes: Array<JsonNode>
selectedValue: string[]
}) => void
Description
Called when the selection changes
Type
boolean
Description
Whether to wrap property keys in double quotes.
Type
string[]
Description
The controlled selected node value
Type
| 'single'
| 'multiple'
Description
Whether the tree supports multiple selection
  • 'single': only one node can be selected
  • 'multiple': multiple nodes can be selected
Type
(
state: NodeState<T>,
) => boolean | undefined
Description
Callback function that determines whether a node should be hidden.
Type
boolean
Description
Whether to show opening and closing brackets around expanded branches. Does not affect collapsed previews.
Type
boolean
Description
Whether to display non-enumerable properties (e.g. prototype methods).
Type
boolean
Description
Whether the tree supports typeahead search
Type
boolean
Description
When true, the component will be completely removed from the DOM when it becomes inactive or hidden, rather than just being hidden with CSS.
PropType
The tree data structure built from data. Use for programmatic tree operations like querying branch values for expand/collapse control.
TreeCollection<JsonNode>
Initial expanded node values. Uses an explicit defaultExpandedValue when provided, otherwise derives the values from defaultExpandedDepth. Use as the initial controlled expandedValue.
| string[]
| undefined
Consumed by JsonViewer.RootProvider to configure display formatting.
QdsJsonViewerOptions
Consumed by JsonViewer.RootProvider and forwarded to the underlying tree root.
Omit<
TreeApiProps<JsonNode>,
'collection'
> &
RenderStrategyApiProps
Type
TreeCollection<JsonNode>
Description
The tree data structure built from data. Use for programmatic tree operations like querying branch values for expand/collapse control.
Type
| string[]
| undefined
Description
Initial expanded node values. Uses an explicit defaultExpandedValue when provided, otherwise derives the values from defaultExpandedDepth. Use as the initial controlled expandedValue.
Type
QdsJsonViewerOptions
Description
Consumed by JsonViewer.RootProvider to configure display formatting.
Type
Omit<
TreeApiProps<JsonNode>,
'collection'
> &
RenderStrategyApiProps
Description
Consumed by JsonViewer.RootProvider and forwarded to the underlying tree root.
Updated by Ryan Bower