list

package
v1.101.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 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