picker

package
v0.15.16 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model[T any] struct {
	// Picked is the item that was picked by the user.
	Picked T
	// contains filtered or unexported fields
}

func New

func New[T any](items []T, render func(T) string) Model[T]

New returns a new picker model. The render function is used to render each item in the list.

func (Model[T]) Init

func (m Model[T]) Init() tea.Cmd

func (Model[T]) Update

func (m Model[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model[T]) View

func (m Model[T]) View() string

Jump to

Keyboard shortcuts

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