remotelist

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package remotelist provides a list that loads items asynchronously.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item = list.Item

Item is re-exported from list for convenience.

type LoadResult

type LoadResult struct {
	Items []Item
	Err   error
}

LoadResult is sent when async loading completes.

type Model

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

Model is a list that loads items asynchronously.

func New

func New(theme styles.Theme, loadingMessage string) *Model

New creates a new remotelist.

func (*Model) Error

func (m *Model) Error() error

Error returns the loading error, if any.

func (*Model) HasError

func (m *Model) HasError() bool

HasError returns true if loading failed.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init starts the loader animation.

func (*Model) InitWithLoader

func (m *Model) InitWithLoader(loadFunc tea.Cmd) tea.Cmd

InitWithLoader starts loading with the given load function.

func (*Model) IsLoaded

func (m *Model) IsLoaded() bool

IsLoaded returns true if loading completed (success or error).

func (*Model) IsLoading

func (m *Model) IsLoading() bool

IsLoading returns true while loading is in progress.

func (*Model) KeyMap

func (m *Model) KeyMap() list.KeyMap

KeyMap returns the list key bindings.

func (*Model) Retry

func (m *Model) Retry() tea.Cmd

Retry resets error state and retries loading.

func (*Model) SelectedItem

func (m *Model) SelectedItem() list.Item

SelectedItem returns the currently selected item.

func (*Model) SetHeight

func (m *Model) SetHeight(height int)

SetHeight sets the list height.

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

SetWidth sets the list width.

func (*Model) ShortHelp

func (m *Model) ShortHelp() []key.Binding

ShortHelp returns the key bindings for the short help view.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) tea.Cmd

Update handles messages.

func (*Model) View

func (m *Model) View() string

View renders the component.

Jump to

Keyboard shortcuts

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