list

package
v1.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package list provides a themed list component.

Index

Constants

View Source
const MaxHeight = 11

MaxHeight is the default maximum height for lists.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item = list.Item

Re-export types from bubbles/list for convenience.

type KeyMap

type KeyMap = list.KeyMap

Re-export types from bubbles/list for convenience.

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model wraps bubbles list with consistent theming.

func New

func New(theme styles.Theme, items []Item) *Model

New creates a new themed list.

func (*Model) FilteringEnabled

func (m *Model) FilteringEnabled() bool

FilteringEnabled returns whether filtering is enabled.

func (*Model) Index

func (m *Model) Index() int

Index returns the index of the currently selected item.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init implements tea.Model.

func (*Model) KeyMap

func (m *Model) KeyMap() KeyMap

KeyMap returns the key bindings for list navigation.

func (*Model) SelectedItem

func (m *Model) SelectedItem() Item

SelectedItem returns the currently selected item.

func (*Model) SetFilteringEnabled

func (m *Model) SetFilteringEnabled(enabled bool)

SetFilteringEnabled controls whether filtering is enabled.

func (*Model) SetHeight

func (m *Model) SetHeight(height int)

SetHeight sets the list height.

func (*Model) SetItems

func (m *Model) SetItems(items []Item) tea.Cmd

SetItems updates the list items.

func (*Model) SetShowPagination

func (m *Model) SetShowPagination(show bool)

SetShowPagination controls pagination visibility.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets both width and height.

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

SetWidth sets the list width.

func (*Model) ShortHelp

func (m *Model) ShortHelp() []key.Binding

ShortHelp returns the key bindings for the short help view.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) tea.Cmd

Update implements tea.Model.

func (*Model) View

func (m *Model) View() string

View renders the list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL