Skip to main content
The List component displays a scrollable, filterable, paginated list in the terminal. It supports both static arrays and dynamic database-backed data sources.

Quick start

Embed it in your model and delegate update / view:

Constructors

Item interfaces

  • Item — The base interface. Only filterValue() is required. Use this when you supply a custom ItemDelegate to control rendering.
  • DefaultItem — Extends Item with title() and description(). Required when using the built-in DefaultDelegate, which renders a two-line item.

Dynamic data sources

For large or database-backed datasets, implement ListDataSource instead of passing an array. The list calls fetchItems on every page change or filter update.
FetchedItems carries four values: filteredItems, matchedItemCount, totalItemCount, and totalPages. Always populate all four so the status bar and paginator display correct counts.

Custom delegates

To control how each row is rendered, implement ItemDelegate:

Configuration

Key bindings

Components overview

Back to all components.

Text input

Single-line text input component.