list

package
v1.105.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ListDefaultStyle is the default list style.
	ListDefaultStyle = charm.NewStyle(lipgloss.NewStyle().Margin(1, 1))
)

Functions

This section is empty.

Types

type Item

type Item list.Item

func Items

func Items[T interface{ Item }](items []T) []Item

Items converts a slice of items into a []Item type slice.

type List

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

List is a component used to select an item from a list.

func New

func New(items []Item, opts ...Option) *List

New creates a new list.

func (*List) Model

func (l *List) Model() *list.Model

Model returns the underlying list.Model.

func (*List) Select

func (l *List) Select() (Item, error)

Select displays the list and prompts the user to select an item.

type Option

type Option func(*List)

func WithStyle

func WithStyle(s charm.Style) Option

Jump to

Keyboard shortcuts

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