picker

package
v0.0.0-...-074b685 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: GPL-3.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 HoverMsg

type HoverMsg[I Item] struct {
	Hovered I
}

type Item

type Item interface {
	Render() string
	Search() string
}

type ItemSource

type ItemSource[I Item] struct {
	// contains filtered or unexported fields
}

func (ItemSource[I]) Len

func (s ItemSource[I]) Len() int

func (ItemSource[I]) String

func (s ItemSource[I]) String(i int) string

type Model

type Model[I Item] struct {
	// contains filtered or unexported fields
}

func New

func New[I Item]() Model[I]

func (Model[I]) Accent

func (m Model[I]) Accent(accent lg.Color) Model[I]

func (Model[I]) GetHeight

func (m Model[I]) GetHeight() int

The height of the picker is header + count == 1 + count

func (Model[I]) GetWidth

func (m Model[I]) GetWidth() int

func (Model[I]) Height

func (m Model[I]) Height(height int) Model[I]

The count depends on how much space we have

func (Model[I]) Init

func (_ Model[I]) Init() tea.Cmd

func (Model[I]) IsSearching

func (m Model[I]) IsSearching() bool

func (Model[I]) Items

func (m Model[I]) Items(items []I) Model[I]

func (Model[I]) Search

func (m Model[I]) Search(search string) Model[I]

if the search is changed externally then filters need to be re-applied

func (Model[I]) Searching

func (m Model[I]) Searching(searching bool) Model[I]

func (Model[I]) Title

func (m Model[I]) Title(title string) Model[I]

func (Model[I]) Update

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

func (Model[I]) View

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

func (Model[I]) Width

func (m Model[I]) Width(width int) Model[I]

type ResizeMsg

type ResizeMsg struct {
	Adjust int
}

type SelectedMsg

type SelectedMsg[I Item] struct {
	Selected I
}

Jump to

Keyboard shortcuts

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