Module list

Source
Expand description

List component with filtering, pagination, contextual help, and customizable rendering.

This module exposes a generic Model<I: Item> plus supporting traits and submodules:

  • Item: Implement for your item type; must be Display + Clone and return a filter_value()
  • ItemDelegate: Controls item render, height, spacing, and update
  • Submodules: defaultitem, keys, and style

§Filtering States

The list supports fuzzy filtering with three states:

  • Unfiltered: No filter active
  • Filtering: User is typing a filter; input is shown in the header
  • FilterApplied: Filter accepted; only matching items are displayed

When filtering is active, fuzzy match indices are stored per item and delegates can use them to apply character-level highlighting (see defaultitem).

§Help Integration

The list implements help::KeyMap, so you can embed help::Model and get contextual help automatically based on the current filtering state.

Re-exports§

pub use defaultitem::DefaultDelegate;
pub use defaultitem::DefaultItem;
pub use defaultitem::DefaultItemStyles;
pub use keys::ListKeyMap;
pub use style::ListStyles;

Modules§

defaultitem
Default item implementation and delegate for list components.
keys
Key bindings for list component navigation and interaction.
style
Styling system for list components.

Structs§

Model
List model containing items, filtering, pagination, and styling.

Enums§

FilterState
Current filtering state of the list.

Traits§

Item
An item that can be displayed in the list.
ItemDelegate
A delegate encapsulates the functionality for a list item.