picker

package
v1.8.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowPicker

func ShowPicker(title string, items []Item, selectedItem *Item, styler *style.Style, options ...tea.ProgramOption) (int, bool)

Types

type Item

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

func NewItem

func NewItem(title, desc string) Item

func (Item) Description

func (i Item) Description() string

func (Item) FilterValue

func (i Item) FilterValue() string

func (Item) Title

func (i Item) Title() string

type Model added in v1.6.1

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

Model is the bubbletea model for the picker.

func NewModel added in v1.6.1

func NewModel(title string, items []Item, selectedItem *Item, styler *style.Style) *Model

NewModel creates a new picker model with the given title and items.

func (*Model) Init added in v1.6.1

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

func (*Model) SelectedIndex added in v1.6.1

func (m *Model) SelectedIndex() (int, bool)

SelectedIndex returns the index of the selected item and whether a selection was made.

func (*Model) Update added in v1.6.1

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

func (*Model) View added in v1.6.1

func (m *Model) View() string

Jump to

Keyboard shortcuts

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