Skip to main content

Module list

Module list 

Source
Expand description

Cleanroom Rust port of upstream Go source file: list/list.go Cleanroom Rust port of upstream Go source file: list/defaultitem.go Cleanroom Rust port of upstream Go source file: list/keys.go Cleanroom Rust port of upstream Go source file: list/style.go Upstream Target Tag / Version: v2.1.0

# List

A feature-rich Bubble Tea component for browsing a general purpose list of items. It features optional filtering, pagination, help, status messages, and a spinner to indicate activity.

The fuzzy filter is an inline port of github.com/sahilm/fuzzy.

Structs§

DefaultDelegate
DefaultDelegate is a standard delegate designed to work in lists. It’s styled by DefaultItemStyles, which can be customized as you like.
DefaultItemStyles
DefaultItemStyles defines styling for a default list item. See DefaultItemView for when these come into play.
FilterMatchesMsg
FilterMatchesMsg contains data about items matched during filtering. The message should be routed to Update for processing.
FilteredItem
FilteredItem holds an item matched by the filter, its index in the unfiltered list, and the rune indices of matched characters.
KeyMap
KeyMap defines keybindings. It satisfies to the help.KeyMap interface, which is used to render the menu.
Model
Model contains the state of this component.
Rank
Rank defines a rank for a given item.
Styles
Styles contains style definitions for this list component. By default, these values are generated by default_styles.

Enums§

FilterState
FilterState describes the current filtering state on the model.

Traits§

DefaultItem
DefaultItem describes an item designed to work with DefaultDelegate.
Item
Item is an item that appears in the list.
ItemDelegate
ItemDelegate encapsulates the general functionality for all list items. The benefit to separating this logic from the item itself is that you can change the functionality of items without changing the actual items themselves.

Functions§

default_filter
DefaultFilter uses the fuzzy matcher to filter through the list. This is set by default.
default_key_map
DefaultKeyMap returns a default set of keybindings.
default_styles
DefaultStyles returns a set of default style definitions for this list component.
new
New returns a new model with sensible defaults.
new_default_delegate
NewDefaultDelegate creates a new delegate with default styles.
new_default_item_styles
NewDefaultItemStyles returns style definitions for a default item. See DefaultItemView for when these come into play.
unsorted_filter
UnsortedFilter uses the fuzzy matcher to filter through the list. It does not sort the results.

Type Aliases§

FilterFunc
FilterFunc takes a term and a list of strings to search through (defined by Item::filter_value). It should return a sorted list of ranks.