list

package
v0.29.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListModel

type ListModel struct {
	List   list.Model
	Choice string
	// Style configures the style applied to all rendering for the list. This can be used to apply padding and borders.
	Style    lipgloss.Style
	Quitting bool
}

ListMode represents the bubble tea model to use for user input

func NewListModel

func NewListModel(choices []string, promptMsg string) ListModel

NewListModel creates a ListModel struct with a list of items, a title, and styling for the list and help.

func (ListModel) Init

func (m ListModel) Init() tea.Cmd

Init used for creating an initial tea command if needed.

func (ListModel) Update

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

Update() handles user input and updates the list model accordingly, allowing the user to select an item from the list and quit the application.

func (ListModel) View

func (m ListModel) View() string

View renders the view after user selection.

Jump to

Keyboard shortcuts

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