list

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListHeight   = 15
	DefaultWidth = 20
)

Variables

View Source
var (
	TitleStyle        = lipgloss.NewStyle().MarginLeft(2)
	ItemStyle         = lipgloss.NewStyle().PaddingLeft(4)
	SelectedItemStyle = lipgloss.NewStyle().PaddingLeft(2).Foreground(lipgloss.Color("170"))
	PaginationStyle   = list.DefaultStyles().PaginationStyle.PaddingLeft(4)
	HelpStyle         = list.DefaultStyles().HelpStyle.PaddingLeft(4).PaddingBottom(1)
	QuitTextStyle     = lipgloss.NewStyle().Margin(1, 0, 2, 4)
)

Functions

This section is empty.

Types

type ItemDelegate

type ItemDelegate struct{}

func (ItemDelegate) Height

func (d ItemDelegate) Height() int

func (ItemDelegate) Render

func (d ItemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

func (ItemDelegate) Spacing

func (d ItemDelegate) Spacing() int

func (ItemDelegate) Update

func (d ItemDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd

type ListItem

type ListItem string

func NewModelItem

func NewModelItem(label string) ListItem

func (ListItem) FilterValue

func (m ListItem) FilterValue() string

type ListModel

type ListModel struct {
	List     list.Model
	Choice   string
	Quitting bool
}

func (ListModel) Init

func (m ListModel) Init() tea.Cmd

func (ListModel) Update

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

func (ListModel) View

func (m ListModel) View() string

Jump to

Keyboard shortcuts

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