menu

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ItemBack = NewItem("Back", "b", "q", "esc")
)

Functions

This section is empty.

Types

type Item

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

func NewItem

func NewItem(name string, shortcutKey string, extraShortcutKeys ...string) Item

func (Item) Name

func (i Item) Name() string

type Model

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

func NewModel

func NewModel(items []Item) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Selected

func (m Model) Selected() string

Selected returns the selected menu item name, or an empty string if none has been selected

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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