Type Alias: ListItem<T, S>
ListItem<
T,S> = {children?:ListItem<T,S>[];hideExpander?:boolean;id:string;indentForDepth?:boolean;indentForIcon?:boolean;section?:false;value:T; } | {children:ListItem<T,S>[];id:string;section:true;value:S; }
Defined in: packages/react/src/jsx.ts:387
A data item for list/grid/column views and dropdowns.
Uses a discriminated union on the section field:
- Regular items have
value: Tand optional tree-mode properties - Section headers have
value: S,section: true, and requiredchildren
Mode is detected from data shape:
- Any item has
section: true→ section mode - Any item has non-empty
children(withoutsection) → tree mode - Otherwise → flat mode
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
T | unknown | The type of data for regular items |
S | unknown | The type of data for section headers |