Skip to Content

ListView

A virtualized scrollable list that renders one item per data entry using a builder function. Maps to a UIToolkit ListView. Item elements are stateless — no full reconciliation is performed per item; the painter is called directly in makeItem and bindItem.

Constructor

ListView

Creates an ListView element.

ParameterDescription
itemsThe data items to display. Must not be null.
itemBuilderA function that produces an Element for each item. Must not be null.
itemHeightThe fixed row height in pixels. Defaults to 32.
selectionModeThe selection behavior. Defaults to None.
onSelectionChangedOptional callback invoked when the selection changes.
keyAn optional key for reconciliation identity.

Properties

ItemBuilder

A function that maps a single data item to an Element describing its visual representation.

ItemHeight

The fixed height in pixels of each row. Defaults to 32.

Items

The ordered list of data items to display.

OnSelectionChanged

Callback invoked whenever the selection changes. Receives the currently selected items as its argument.

SelectionMode

Controls how many items can be selected at once.

Last updated on