components

package
v0.0.0-...-ef2e355 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListComponent

type ListComponent struct {
	Model list.Model
	Style lipgloss.Style
}

func NewListComponent

func NewListComponent(config *ListComponentConfig) *ListComponent

func (*ListComponent) Init

func (c *ListComponent) Init() tea.Cmd

func (*ListComponent) Update

func (c *ListComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ListComponent) View

func (c *ListComponent) View() string

type ListComponentConfig

type ListComponentConfig struct {
	Items               []*ListItem
	DefaultSearchFilter string
	OnSelect            OnSelectFunc
}

type ListItem

type ListItem struct {
	ID any

	Name    string
	Details string
}

func (*ListItem) Description

func (i *ListItem) Description() string

func (*ListItem) FilterValue

func (i *ListItem) FilterValue() string

func (*ListItem) Title

func (i *ListItem) Title() string

type OnSelectFunc

type OnSelectFunc func(*ListItem)

Jump to

Keyboard shortcuts

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