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
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§
- Default
Delegate - DefaultDelegate is a standard delegate designed to work in lists. It’s
styled by
DefaultItemStyles, which can be customized as you like. - Default
Item Styles - DefaultItemStyles defines styling for a default list item.
See
DefaultItemViewfor when these come into play. - Filter
Matches Msg - FilterMatchesMsg contains data about items matched during filtering. The message should be routed to Update for processing.
- Filtered
Item - 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§
- Filter
State - FilterState describes the current filtering state on the model.
Traits§
- Default
Item - DefaultItem describes an item designed to work with DefaultDelegate.
- Item
- Item is an item that appears in the list.
- Item
Delegate - 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
DefaultItemViewfor 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§
- Filter
Func - 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.