Flutter docs
Default skin

Listy

A high-performance list that supports grouping and can virtualize long data sets.

When to use

  • When you need to render a long list without paying the cost of mounting every row — enable virtual to render only the rows in view.
  • When the list needs grouped sections with sticky headers.
  • When you need imperative control over scroll position (jump to an item, a group, or a pixel offset).

Examples

Basic

Basic example.

Virtual scrolling

A long list of 10,000 rows. Set virtual and height to enable virtual scrolling, so only the rows in view are rendered.

Grouping and sticky headers

Use group to derive a group key from each item and render group headers. With sticky enabled, the current group header sticks to the top while scrolling.

Rich content

itemRender can render arbitrarily rich content, and rows do not need the same height.

Drag sorting

Implement drag sorting for list items by integrating the third-party library dnd-kit.

Infinite loading

Detect in onScroll that the list is about to reach the bottom, then load the next page on demand for endless scrolling. Combined with virtual, only the rows in view are rendered no matter how much data piles up.

Custom semantic dom styling

Customize the semantic DOM styles of Listy with classNames and styles.

API

Listy are exported from @ceebee/ui/client.

Listy

PropertyDescriptionTypeDefaultVersion
classNamesSemantic class names{ root?, item?, groupHeader? }-6.6.0
groupGrouping config, see Group belowGroup<T, K>-6.6.0
heightHeight of the scroll container; content scrolls when it overflowsnumber-6.6.0
itemRenderRender a single row(item: T, index: number) => ReactNode-6.6.0
itemsData source of the listT[][]6.6.0
rowKeyUnique key of an item, a field name or a getterkeyof T | (item: T) => Key-6.6.0
stickyWhether group headers stick to the topbooleanfalse6.6.0
stylesSemantic inline styles{ root?, item?, groupHeader? }-6.6.0
virtualWhether to enable virtual scrolling, rendering only rows in view, requires heightbooleanfalse6.6.0
onScrollNative scroll event handlerReact.UIEventHandler<HTMLElement>-6.6.0

Group

PropertyDescriptionTypeDefaultVersion
keyCompute the group key an item belongs to; items with the same key are grouped together(item: T) => K——
titleRender the group header; receives the group key and its items(groupKey: K, items: T[]) => ReactNode——

Ref

PropertyDescriptionTypeDefaultVersion
scrollToScroll to a position, an item, or a group(config?: ListyScrollToConfig) => void——
ShapeDescription———
numberScroll to a pixel offset (scrollTop)———
{ top?, left? }Scroll to an absolute pixel position———
{ key, align?, offset? }Scroll to the item whose rowKey matches key———
{ groupKey, align?, offset? }Scroll to a group header———