suggest

package
v1.1.66 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Label       string // display text
	Description string // optional description
	Value       string // the actual value to insert
}

Item represents a single autocomplete suggestion.

type Model

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

Model is the autocomplete suggestion dropdown component.

func New

func New(width int) Model

New creates a new suggestion Model with default settings.

func (Model) CursorDown

func (m Model) CursorDown() Model

CursorDown moves the selection down, wrapping to the top at the bottom.

func (Model) CursorUp

func (m Model) CursorUp() Model

CursorUp moves the selection up, wrapping to the bottom at the top.

func (Model) Selected

func (m Model) Selected() (Item, bool)

Selected returns the currently selected item, or false if nothing is selected.

func (Model) SetItems

func (m Model) SetItems(items []Item) Model

SetItems sets the available completion items and re-filters.

func (Model) SetWidth

func (m Model) SetWidth(width int) Model

SetWidth sets the dropdown width.

func (Model) Update

func (m Model) Update(query string) Model

Update updates the filter based on the current input query.

func (Model) View

func (m Model) View() string

View renders the suggestion dropdown.

func (Model) Visible

func (m Model) Visible() bool

Visible returns whether the dropdown should be shown.

Jump to

Keyboard shortcuts

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