Skip to main content

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: T and optional tree-mode properties
  • Section headers have value: S, section: true, and required children

Mode is detected from data shape:

  • Any item has section: true → section mode
  • Any item has non-empty children (without section) → tree mode
  • Otherwise → flat mode

Type Parameters

Type ParameterDefault typeDescription
TunknownThe type of data for regular items
SunknownThe type of data for section headers