Skip to main content

ITreeViewSchema

@spartanfx/react v1.2.2


@spartanfx/react / index / ITreeViewSchema

Interface: ITreeViewSchema<T>

Schema configuration for mapping item fields to tree structure.

Supports both flat (id/parentId) and nested (children) data structures.

Type Parameters

T

T = any

Properties

PropertyTypeDescription
childrenField?string | keyof TField name for nested children array. If provided, expects nested structure
idField?string | keyof TField name for the unique identifier. Defaults to 'id'
labelField?string | keyof TField name for the display label. Defaults to 'label'
parentIdField?string | keyof TField name for the parent ID. Defaults to 'parentId'
pathField?string | keyof TField name for a path string that encodes the hierarchy (e.g. "/Docs/Reports/Q1.pdf"). When set, the tree is built from path segments instead of parentId: each item nests under the item at its parent directory, and any missing intermediate folders are synthesized as nodes. Use this for document-library style data that has no parent/child lookup. Ignored when childrenField (nested mode) is provided.