All components subtlesolidxssmmd
JSON Tree View
Explore JSON as an expandable tree with type-colored values, previews, and full keyboard navigation.
{id: 1815, name: "Ada Lovelace", email: "ada@analytical.engine", …}
id: 1815
name: "Ada Lovelace"
email: "ada@analytical.engine"
verified: true
manager: null
languages: (3) ["English", "French", "Mathematics"]
0: "English"
1: "French"
2: "Mathematics"
length: 3
address: {city: "London", country: "UK"}
city: "London"
country: "UK"
1234567891011121314151617181920212223import { JsonTreeView } from "#components/ui/ark-ui/json-tree-view.tsx";
const data = { name: "Ada Lovelace", verified: true, manager: null, languages: ["English", "French"], address: { city: "London", country: "UK" },};
export function Example() { return ( // Ark's json-tree-view builds the collection from `data`; expansion, // selection, and arrow-key navigation are the tree-view machine's. // Values carry data-type and the semantic type colors. <JsonTreeView.Root data={data} defaultExpandedDepth={2} size="md"> <JsonTreeView.Tree aria-label="User" /> </JsonTreeView.Root> );}
// options: quotesOnKeys, maxPreviewItems, collapseStringsAfterLength (Root);// arrow, indentGuide, renderValue (Tree)Variants
{id: 1815, name: "Ada Lovelace", email: "ada@analytical.engine", …}
id: 1815
name: "Ada Lovelace"
email: "ada@analytical.engine"
verified: true
manager: null
languages: (3) ["English", "French", "Mathematics"]
0: "English"
1: "French"
2: "Mathematics"
length: 3
address: {city: "London", country: "UK"}
city: "London"
country: "UK"
{id: 1815, name: "Ada Lovelace", email: "ada@analytical.engine", …}
id: 1815
name: "Ada Lovelace"
email: "ada@analytical.engine"
verified: true
manager: null
languages: (3) ["English", "French", "Mathematics"]
0: "English"
1: "French"
2: "Mathematics"
length: 3
address: {city: "London", country: "UK"}
city: "London"
country: "UK"
Sizes
{id: 1815, name: "Ada Lovelace", email: "ada@analytical.engine", …}
id: 1815
name: "Ada Lovelace"
email: "ada@analytical.engine"
verified: true
manager: null
languages: (3) ["English", "French", "Mathematics"]
0: "English"
1: "French"
2: "Mathematics"
length: 3
address: {city: "London", country: "UK"}
city: "London"
country: "UK"
{id: 1815, name: "Ada Lovelace", email: "ada@analytical.engine", …}
id: 1815
name: "Ada Lovelace"
email: "ada@analytical.engine"
verified: true
manager: null
languages: (3) ["English", "French", "Mathematics"]
0: "English"
1: "French"
2: "Mathematics"
length: 3
address: {city: "London", country: "UK"}
city: "London"
country: "UK"
{id: 1815, name: "Ada Lovelace", email: "ada@analytical.engine", …}
id: 1815
name: "Ada Lovelace"
email: "ada@analytical.engine"
verified: true
manager: null
languages: (3) ["English", "French", "Mathematics"]
0: "English"
1: "French"
2: "Mathematics"
length: 3
address: {city: "London", country: "UK"}
city: "London"
country: "UK"
Custom values
renderValue replaces a leaf's default rendering, here turning URLs into links; quotesOnKeys prints keys JSON-style.
{status: 200, ok: true, url: "https://api.example.com/v1/use…", …}
"status": 200
"ok": true
"data": {user: {…}, plan: {…}}
"user": {id: 42, name: "Grace Hopper", roles: […], …}
"id": 42
"name": "Grace Hopper"
"roles": (2) ["admin", "editor"]
"0": "admin"
"1": "editor"
"length": 2
"lastSeen": null
"plan": {tier: "pro", seats: 12, trial: false}
"tier": "pro"
"seats": 12
"trial": false
1234567891011// renderValue swaps in custom leaf rendering; return undefined to keep the default<JsonTreeView.Root data={response} defaultExpandedDepth={3} quotesOnKeys> <JsonTreeView.Tree aria-label="Response" renderValue={({ value, type }) => type === "string" && value.startsWith("https://") ? ( <a href={value} target="_blank" rel="noreferrer">"{value}"</a> ) : undefined } /></JsonTreeView.Root>Install
1npx stylexblocks add json-tree-viewSource
components/ui/ark-ui/json-tree-view.tsx
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665import * as stylex from "@stylexjs/stylex";import { createContext, useContext } from "react";import { JsonTreeView as ArkJsonTreeView } from "@ark-ui/react/json-tree-view";import { TreeView as ArkTreeView, useTreeViewContext, useTreeViewNodeContext,} from "@ark-ui/react/tree-view";import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";import { createSlotRecipeContext } from "#lib/ark-ui/create-slot-recipe-context.tsx";import { defineSlotRecipe, fromMap, resolveSlotStyles, type WithStyleOverrides,} from "#lib/recipe-props.ts";import { treeViewTreeIconVars } from '@stylexblocks/ui/slot-recipes/tree-view.stylex.ts'
import { colorPalette } from '@stylexblocks/ui/color-palette.stylex.ts'import { durations } from '@stylexblocks/ui/tokens/durations.stylex.ts'import { fontSizes } from '@stylexblocks/ui/tokens/font-sizes.stylex.ts'import { fontWeights } from '@stylexblocks/ui/tokens/font-weights.stylex.ts'import { lineHeights } from '@stylexblocks/ui/tokens/line-heights.stylex.ts'import { semanticColors } from '@stylexblocks/ui/semantic-tokens/colors.stylex.ts'import { semanticRadii } from '@stylexblocks/ui/semantic-tokens/radii.stylex.ts'import { sizes } from '@stylexblocks/ui/tokens/sizes.stylex.ts'import { spacing } from '@stylexblocks/ui/tokens/spacing.stylex.ts'
const treeViewRoot = stylex.create({ base: { width: sizes.full, display: 'flex', flexDirection: 'column', gap: spacing._2, },})
const treeViewTree = stylex.create({ base: { display: 'flex', flexDirection: 'column', '--tree-item-gap': spacing._2, '--tree-indentation': 'calc(var(--tree-indent-size) + var(--tree-icon-size) * 0.5)', [treeViewTreeIconVars.width]: 'var(--tree-icon-size)', [treeViewTreeIconVars.height]: 'var(--tree-icon-size)', },})
const treeViewTreeSizes = stylex.create({ md: { fontSize: fontSizes.sm, lineHeight: lineHeights.sm, '--tree-indent-size': spacing._4, '--tree-icon-size': spacing._4, '--tree-padding-inline': spacing._3, '--tree-padding-block': spacing._1_5, }, sm: { fontSize: fontSizes.sm, lineHeight: lineHeights.sm, '--tree-indent-size': spacing._4, '--tree-icon-size': spacing._3, '--tree-padding-inline': spacing._3, '--tree-padding-block': spacing._1, }, xs: { fontSize: fontSizes.xs, lineHeight: lineHeights.xs, '--tree-indent-size': spacing._4, '--tree-icon-size': spacing._3, '--tree-padding-inline': spacing._2, '--tree-padding-block': spacing._1, },})
const treeViewTreeIcon = stylex.create({ base: { width: treeViewTreeIconVars.width, height: treeViewTreeIconVars.height, },})
const treeViewLabel = stylex.create({ base: { fontWeight: fontWeights.medium, fontSize: fontSizes.sm, lineHeight: lineHeights.sm, },})
const treeViewBranch = stylex.create({ base: { position: 'relative', },})
const treeViewBranchContent = stylex.create({ base: { position: 'relative', },})
const treeViewBranchContentAnimateContents = stylex.create({ true: { overflow: 'hidden', animationName: { default: null, ':is([data-open], [data-state="open"])': 'expand-height, fade-in', ':is([data-closed], [data-state="closed"])': 'collapse-height, fade-out', }, animationDuration: { default: null, ':is([data-open], [data-state="open"])': durations.moderate, ':is([data-closed], [data-state="closed"])': durations.moderate, }, },})
const treeViewBranchIndentGuide = stylex.create({ base: { height: '100%', width: '1px', backgroundColor: semanticColors.border, position: 'absolute', '--tree-depth': 'calc(var(--depth) - 1)', '--tree-indentation-offset': 'calc(var(--tree-indentation) * var(--tree-depth))', '--tree-offset': 'calc(var(--tree-padding-inline) + var(--tree-indentation-offset))', insetInlineStart: 'calc(var(--tree-offset) + var(--tree-icon-size) * 0.5)', zIndex: 1, },})
const treeViewBranchIndicator = stylex.create({ base: { color: semanticColors.fgMuted, transformOrigin: 'center', transitionDuration: durations.moderate, transitionProperty: 'transform', transitionTimingFunction: 'ease-in-out', },})
const treeViewBranchTrigger = stylex.create({ base: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', },})
const treeViewBranchControl = stylex.create({ base: { display: 'flex', alignItems: 'center', gap: 'var(--tree-item-gap)', borderRadius: semanticRadii.controlMd, userSelect: 'none', position: 'relative', '--tree-depth': 'calc(var(--depth) - 1)', '--tree-indentation-offset': 'calc(var(--tree-indentation) * var(--tree-depth))', '--tree-offset': 'calc(var(--tree-padding-inline) + var(--tree-indentation-offset))', paddingInlineStart: 'var(--tree-offset)', paddingInlineEnd: 'var(--tree-padding-inline)', paddingBlock: 'var(--tree-padding-block)', outlineWidth: { default: null, ':focus-visible': 'var(--focus-ring-width, 0)', }, outlineOffset: { default: null, ':focus-visible': '0px', }, outlineStyle: { default: null, ':focus-visible': 'solid', }, outlineColor: { default: null, ':focus-visible': colorPalette.focusRing, }, '--focus-ring-color': semanticColors.borderEmphasized, '--focus-ring-width': '2px', opacity: { default: null, ':is(:disabled, [disabled], [data-disabled])': 0.5, }, cursor: { default: null, ':is(:disabled, [disabled], [data-disabled])': 'not-allowed', }, },})
const treeViewBranchControlVariants = stylex.create({ subtle: {}, solid: {},})
const treeViewItem = stylex.create({ base: { display: 'flex', alignItems: 'center', gap: 'var(--tree-item-gap)', borderRadius: semanticRadii.controlMd, userSelect: 'none', position: 'relative', '--tree-depth': 'calc(var(--depth) - 1)', '--tree-indentation-offset': 'calc(var(--tree-indentation) * var(--tree-depth))', '--tree-offset': 'calc(var(--tree-padding-inline) + var(--tree-indentation-offset))', paddingInlineStart: 'var(--tree-offset)', paddingInlineEnd: 'var(--tree-padding-inline)', paddingBlock: 'var(--tree-padding-block)', outlineWidth: { default: null, ':focus-visible': 'var(--focus-ring-width, 0)', }, outlineOffset: { default: null, ':focus-visible': '0px', }, outlineStyle: { default: null, ':focus-visible': 'solid', }, outlineColor: { default: null, ':focus-visible': colorPalette.focusRing, }, '--focus-ring-color': semanticColors.borderEmphasized, '--focus-ring-width': '2px', opacity: { default: null, ':is(:disabled, [disabled], [data-disabled])': 0.5, }, cursor: { default: null, ':is(:disabled, [disabled], [data-disabled])': 'not-allowed', }, },})
const treeViewItemVariants = stylex.create({ subtle: {}, solid: {},})
const treeViewItemText = stylex.create({ base: { flex: 1, },})
const treeViewBranchText = stylex.create({ base: { flex: 1, },})
const treeViewNodeCheckbox = stylex.create({ base: { display: 'inline-flex', },})
export type TreeViewSize = keyof typeof treeViewTreeSizes
export type TreeViewVariant = keyof typeof treeViewBranchControlVariants
export type TreeViewAnimateContent = keyof typeof treeViewBranchContentAnimateContents
// The tree-view recipe carries the rows, indentation, and indent guides; this// adds the JSON layer: monospace text, a palette-tinted key, and per-type value// colors keyed off the semantic status palettes (string → success, number →// info, boolean → warning, null/undefined → subtle).const jsonStatic = stylex.create({ tree: { fontFamily: fonts.mono }, row: { cursor: "pointer", color: semanticColors.fg, backgroundColor: { default: "transparent", ":hover": semanticColors.bgMuted }, // Inset ring: open branch content clips overflow (height animation). outlineOffset: { default: null, ":focus-visible": "-2px" }, }, text: { minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, key: { color: colorPalette.fg }, colon: { color: semanticColors.fgMuted }, indicatorExpanded: { transform: { default: null, ':is([data-state="open"])': "rotate(90deg)", }, }, arrow: { display: "inline-flex", flexShrink: 0, width: "var(--tree-icon-size)", height: "var(--tree-icon-size)", }, leafSpacer: { flexShrink: 0, width: "var(--tree-icon-size)" },});
const jsonValueTypes = stylex.create({ string: { color: semanticColors.successFg }, number: { color: semanticColors.infoFg }, bigint: { color: semanticColors.infoFg }, boolean: { color: semanticColors.warningFg }, null: { color: semanticColors.fgSubtle, fontStyle: "italic" }, undefined: { color: semanticColors.fgSubtle, fontStyle: "italic" }, object: { color: semanticColors.fgMuted }, array: { color: semanticColors.fgMuted }, other: { color: semanticColors.fgMuted },});
const jsonRowSelected = stylex.create({ subtle: { backgroundColor: { default: null, ":is([data-selected])": colorPalette.muted, }, }, solid: { backgroundColor: { default: null, ":is([data-selected])": colorPalette.solid, }, color: { default: null, ":is([data-selected])": colorPalette.contrast, }, },});
const treeViewRecipe = defineSlotRecipe({ slots: { root: { styles: treeViewRoot }, tree: { styles: treeViewTree, sizes: treeViewTreeSizes }, branch: { styles: treeViewBranch }, branchContent: { styles: treeViewBranchContent }, branchIndentGuide: { styles: treeViewBranchIndentGuide }, branchIndicator: { styles: treeViewBranchIndicator }, branchControl: { styles: treeViewBranchControl, variants: treeViewBranchControlVariants, }, branchText: { styles: treeViewBranchText }, item: { styles: treeViewItem, variants: treeViewItemVariants }, itemText: { styles: treeViewItemText }, }, defaultVariants: { size: "md", variant: "subtle" },});
const { withProvider, withContext } = createSlotRecipeContext(treeViewRecipe);
// ---------------------------------------------------------------------------// Value formatting (plain JSON plus the JS primitives JSON can't carry).
type JsonValueType = keyof typeof jsonValueTypes;
interface JsonOptions { /** Wrap keys in double quotes. */ quotesOnKeys?: boolean; /** Entries shown in a collapsed object/array preview. */ maxPreviewItems?: number; /** Strings longer than this are cut with "…" inside previews. */ collapseStringsAfterLength?: number;}
const OptionsContext = createContext<Required<JsonOptions>>({ quotesOnKeys: false, maxPreviewItems: 3, collapseStringsAfterLength: 30,});
function typeOf(value: unknown): JsonValueType { if (value === null) return "null"; if (Array.isArray(value)) return "array"; const t = typeof value; if (t === "string" || t === "number" || t === "boolean" || t === "bigint" || t === "undefined") { return t; } if (t === "object") return "object"; return "other";}
function formatLeaf(value: unknown, type: JsonValueType, max = Infinity): string { if (type === "string") { const s = JSON.stringify(value) ?? ""; return s.length - 2 > max ? `${s.slice(0, max + 1)}…"` : s; } if (type === "bigint") return `${String(value)}n`; if (type === "array") return `Array(${(value as unknown[]).length})`; if (type === "object") { if (value instanceof Date) return value.toISOString(); return "{…}"; } return String(value);}
function formatPreview(value: unknown, type: JsonValueType, opts: Required<JsonOptions>) { const max = opts.maxPreviewItems; const mini = (v: unknown) => { const t = typeOf(v); return t === "array" ? "[…]" : formatLeaf(v, t, opts.collapseStringsAfterLength); }; if (type === "array") { const items = value as unknown[]; const shown = items.slice(0, max).map(mini); if (items.length > max) shown.push("…"); return `${items.length > 0 ? `(${items.length}) ` : ""}[${shown.join(", ")}]`; } const entries = Object.entries(value as Record<string, unknown>); const shown = entries.slice(0, max).map(([k, v]) => `${k}: ${mini(v)}`); if (entries.length > max) shown.push("…"); return `{${shown.join(", ")}}`;}
// Ark's JSON collection node (from `@zag-js/json-tree-utils`), as far as the// renderer reads it.interface JsonNode { value: unknown; keyPath: (string | number)[]; children?: JsonNode[]; isNonEnumerable?: boolean;}
function nodeKey(node: JsonNode) { const path = node.keyPath; if (path.length === 0 || (path.length === 1 && path[0] === "$")) return null; return String(path[path.length - 1]);}
function describe(node: JsonNode, isBranch: boolean) { const key = nodeKey(node); const type = typeOf(node.value); const text = isBranch ? `${type === "array" ? `Array(${(node.value as unknown[]).length})` : "Object"}, expandable with ${node.children?.length ?? 0} entries` : formatLeaf(node.value, type); return [key, text].filter(Boolean).join(": ");}
// ---------------------------------------------------------------------------// Parts.
const BranchControl = withContext( function BranchControlNode(props: React.ComponentProps<typeof ArkTreeView.BranchControl>) { const node = useTreeViewNodeContext(); return ( <ArkTreeView.BranchControl {...props} data-selected={node.selected ? "" : undefined} /> ); }, (v) => [ ...resolveSlotStyles(treeViewRecipe.slots.branchControl, v), jsonStatic.row, fromMap(jsonRowSelected, v.variant), ], "JsonTreeViewBranchControl",);
const Item = withContext( function ItemNode(props: React.ComponentProps<typeof ArkTreeView.Item>) { const node = useTreeViewNodeContext(); return <ArkTreeView.Item {...props} data-selected={node.selected ? "" : undefined} />; }, (v) => [ ...resolveSlotStyles(treeViewRecipe.slots.item, v), jsonStatic.row, fromMap(jsonRowSelected, v.variant), ], "JsonTreeViewItem",);
const BranchIndicator = withContext( function BranchIndicatorNode(props: React.ComponentProps<typeof ArkTreeView.BranchIndicator>) { const node = useTreeViewNodeContext(); return ( <ArkTreeView.BranchIndicator {...props} data-state={node.expanded ? "open" : "closed"} /> ); }, () => [treeViewBranchIndicator.base, jsonStatic.arrow, jsonStatic.indicatorExpanded], "JsonTreeViewBranchIndicator",);
const Branch = withContext(ArkTreeView.Branch, "branch", "JsonTreeViewBranch");const BranchText = withContext( ArkTreeView.BranchText, () => [treeViewBranchText.base, jsonStatic.text], "JsonTreeViewBranchText",);const BranchContent = withContext( ArkTreeView.BranchContent, () => [treeViewBranchContent.base, treeViewBranchContentAnimateContents.true], "JsonTreeViewBranchContent",);const BranchIndentGuide = withContext( ArkTreeView.BranchIndentGuide, "branchIndentGuide", "JsonTreeViewBranchIndentGuide",);const ItemText = withContext( ArkTreeView.ItemText, () => [treeViewItemText.base, jsonStatic.text], "JsonTreeViewItemText",);
function DefaultArrow() { return ( <svg viewBox="0 0 16 16" fill="none" width="100%" height="100%" aria-hidden="true"> <path d="M6 3.5 10.5 8 6 12.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" /> </svg> );}
interface NodeRenderProps { /** Branch arrow; defaults to a chevron. */ arrow?: React.ReactNode; /** Vertical guides along open branches. */ indentGuide?: boolean; /** Custom leaf value rendering; return `undefined` to keep the default. */ renderValue?: (details: { value: unknown; type: JsonValueType }) => React.ReactNode;}
function JsonValue({ node, isBranch, renderValue }: { node: JsonNode; isBranch: boolean } & Pick<NodeRenderProps, "renderValue">) { const opts = useContext(OptionsContext); const key = nodeKey(node); const type = typeOf(node.value); const custom = isBranch ? undefined : renderValue?.({ value: node.value, type }); return ( <> {key !== null ? ( <> <span data-kind="key" {...stylex.props(jsonStatic.key)}> {opts.quotesOnKeys ? `"${key}"` : key} </span> <span data-kind="colon" {...stylex.props(jsonStatic.colon)}> {": "} </span> </> ) : null} <span data-type={type} {...stylex.props(jsonValueTypes[type])}> {custom ?? (isBranch ? formatPreview(node.value, type, opts) : formatLeaf(node.value, type))} </span> </> );}
function JsonTreeNode({ node, indexPath, ...renderProps}: { node: JsonNode; indexPath: number[] } & NodeRenderProps) { const tree = useTreeViewContext(); const state = tree.getNodeState({ node, indexPath }); const { arrow, indentGuide = true, renderValue } = renderProps; return ( <ArkTreeView.NodeProvider node={node} indexPath={indexPath}> {state.isBranch ? ( <Branch> <BranchControl aria-label={describe(node, true)}> <BranchIndicator>{arrow ?? <DefaultArrow />}</BranchIndicator> <BranchText> <JsonValue node={node} isBranch /> </BranchText> </BranchControl> <BranchContent> {indentGuide ? <BranchIndentGuide /> : null} {node.children?.map((child, index) => ( <JsonTreeNode key={index} node={child} indexPath={[...indexPath, index]} {...renderProps} /> ))} </BranchContent> </Branch> ) : ( <Item aria-label={describe(node, false)}> <span aria-hidden="true" {...stylex.props(jsonStatic.leafSpacer)} /> <ItemText> <JsonValue node={node} isBranch={false} renderValue={renderValue} /> </ItemText> </Item> )} </ArkTreeView.NodeProvider> );}
type TreeProps = Omit<React.ComponentProps<typeof ArkTreeView.Tree>, "children"> & NodeRenderProps;
function TreeNode({ arrow, indentGuide, renderValue, ...props }: TreeProps) { const tree = useTreeViewContext(); const children = tree.collection.getNodeChildren(tree.collection.rootNode) as JsonNode[]; return ( <ArkTreeView.Tree {...props}> {children.map((child, index) => ( <JsonTreeNode key={index} node={child} indexPath={[index]} arrow={arrow} indentGuide={indentGuide} renderValue={renderValue} /> ))} </ArkTreeView.Tree> );}
type ArkRootProps = React.ComponentProps<typeof ArkJsonTreeView.Root>;
function RootNode({ quotesOnKeys = false, maxPreviewItems = 3, collapseStringsAfterLength = 30, defaultExpandedDepth = 1, ...props}: ArkRootProps) { return ( <OptionsContext.Provider value={{ quotesOnKeys, maxPreviewItems, collapseStringsAfterLength }}> <ArkJsonTreeView.Root {...props} defaultExpandedDepth={defaultExpandedDepth} /> </OptionsContext.Provider> );}
export type JsonTreeViewRootProps = WithStyleOverrides<ArkRootProps> & { variant?: "subtle" | "solid"; size?: "md" | "sm" | "xs";};
/** * JsonTreeView — Ark UI's json-tree-view (the tree-view machine over a JSON * collection) rendered through the `tree-view` recipe. `<JsonTreeView.Root * data defaultExpandedDepth variant size>` builds the collection and resolves * the recipe once; `<JsonTreeView.Tree>` walks it with styleable tree-view * parts so keys, previews, and type-colored values (`data-type`) are StyleX, * not Ark's unstyled internals. Keyboard (arrows, Home/End, typeahead off), * expansion, and selection are the machine's. `quotesOnKeys`, * `maxPreviewItems`, and `collapseStringsAfterLength` tune the text; `arrow`, * `indentGuide`, and `renderValue` on Tree tune the rows. */export const JsonTreeView = { Root: withProvider(RootNode, "root", "JsonTreeViewRoot"), Tree: withContext( TreeNode, (v) => [...resolveSlotStyles(treeViewRecipe.slots.tree, v), jsonStatic.tree], "JsonTreeViewTree", ),};