Documentation
¶
Overview ¶
Package tui provides terminal user interface components including a fuzzy-search selector for selecting items from lists.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCancelled = errors.ErrCanceled
ErrCancelled is returned when the user cancels the selection
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item interface {
// FilterValue returns the string used for fuzzy matching
FilterValue() string
// Title returns the main display text
Title() string
// Description returns secondary text (displayed dimmed)
Description() string
}
Item interface for selectable items
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubbletea model for the selector
func (Model) SelectedIndex ¶
SelectedIndex returns the original index of the selected item, or -1 if cancelled
type Styles ¶
type Styles struct {
Title lipgloss.Style
SelectedItem lipgloss.Style
NormalItem lipgloss.Style
MatchedChars lipgloss.Style
Cursor lipgloss.Style
Help lipgloss.Style
NoResults lipgloss.Style
SearchPrompt lipgloss.Style
MethodGET lipgloss.Style
MethodPOST lipgloss.Style
MethodPUT lipgloss.Style
MethodDELETE lipgloss.Style
MethodPATCH lipgloss.Style
MethodDefault lipgloss.Style
Description lipgloss.Style
Index lipgloss.Style
SelectedIndex lipgloss.Style
}
Styles holds the styling configuration for the selector
func DefaultStyles ¶
func DefaultStyles() Styles
DefaultStyles returns the default styling for the selector
func NoColorStyles ¶
func NoColorStyles() Styles
NoColorStyles returns styles without colors for non-color mode
Click to show internal directories.
Click to hide internal directories.