Skip to content

API Reference / @gtkx/components / ListItem

Type Alias: ListItem<T> ​

ListItem<T> = object

Defined in: packages/components/src/types.ts:19

A single item in a collection model, identified by a stable id and holding an arbitrary value. Nested items form a tree.

Type Parameters ​

T ​

T = unknown

Properties ​

children? ​

optional children?: ListItem<T>[]

Defined in: packages/components/src/types.ts:28

Child items in an acyclic tree, read only as rows are drawn.


id ​

id: string

Defined in: packages/components/src/types.ts:24

Stable identifier that names the item in selection and expansion, so keep it unique across the collection. A row keeps its component state while its id stays among the same siblings.


shouldHideExpander? ​

optional shouldHideExpander?: boolean

Defined in: packages/components/src/types.ts:30

Hides the tree expander arrow even when the item has children, through hide-expander.


shouldIndentForDepth? ​

optional shouldIndentForDepth?: boolean

Defined in: packages/components/src/types.ts:32

Adds indentation matching the item's depth in the tree, through indent-for-depth.


shouldIndentForIcon? ​

optional shouldIndentForIcon?: boolean

Defined in: packages/components/src/types.ts:34

Reserves indentation space for an expander icon, through indent-for-icon.


value ​

value: T

Defined in: packages/components/src/types.ts:26

Payload handed to the cell renderer as ListItemRenderArgs.item.