Documentation
¶
Overview ¶
Package list wraps bubbles/list with a task-pilot-style delegate: a thick left-border selection accent, title+description rows, and built-in filtering. Styling is driven by the active theme and can be refreshed via Restyle.
Index ¶
- type Item
- type List
- func (l *List) IndexAt(row int) int
- func (l *List) Restyle()
- func (l *List) SelectID(id string) bool
- func (l *List) SelectIndex(i int)
- func (l *List) Selected() (Item, bool)
- func (l *List) SetCompact(b bool)
- func (l *List) SetFilterHint(hint string)
- func (l *List) SetFilterPlaceholder(ph string)
- func (l *List) SetItems(items []Item) tea.Cmd
- func (l *List) SetSize(width, height int)
- func (l *List) SettingFilter() bool
- func (l *List) Update(msg tea.Msg) tea.Cmd
- func (l *List) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
Item is a generic list row carrying display text plus an id/index payload.
func (Item) Description ¶
Description implements list.DefaultItem.
type List ¶
List wraps a bubbles list.Model.
func (*List) IndexAt ¶
IndexAt maps a 0-based visible row (from the top of the rendered list) to the absolute item index, or -1 if the row is past the last visible item. It accounts for the delegate's item height + spacing and the current page.
func (*List) Restyle ¶
func (l *List) Restyle()
Restyle rebuilds the delegate styling from the current theme.
func (*List) SelectID ¶
SelectID highlights an item by ID within the currently visible (filtered) rows. It returns false when the filter excludes the item.
func (*List) SelectIndex ¶
SelectIndex highlights the item at the given absolute index.
func (*List) SetCompact ¶
SetCompact toggles single-line rows (title only, no inter-row spacing) and restyles. Callers that want the description folded into the row build a combined single-line title before SetItems; this only controls the delegate.
func (*List) SetFilterHint ¶
SetFilterHint sets the faint helper text shown in place of the title while the user is not actively filtering, advertising the "/" filter. It is only shown when the list has items; an empty list shows nothing.
func (*List) SetFilterPlaceholder ¶
SetFilterPlaceholder sets the example text shown inside the "/" filter input before the user types anything, hinting at what can be matched.
func (*List) SettingFilter ¶
SettingFilter reports whether the user is currently typing a filter.