menu

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright © 2025 Eden Phillips

Copyright © 2025 Eden Phillips

Index

Constants

This section is empty.

Variables

View Source
var (
	LogoStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("7")).
				Bold(true).
				Align(lipgloss.Center).
				Margin(1, 0)

	MenuItemStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("8")).
					PaddingLeft(2).
					Margin(1, 0)

	MenuItemSelectedStyle = lipgloss.NewStyle().
							Foreground(lipgloss.Color("7")).
							Bold(true).
							PaddingLeft(2).
							Margin(1, 0)

	MenuHelpStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("8")).
					MarginTop(2).
					Align(lipgloss.Center)
)
View Source
var DefaultKeyMap = KeyMap{
	Quit: key.NewBinding(
		key.WithKeys("ctrl+c", "q"),
		key.WithHelp("ctrl+c/q", "quit"),
	),
	Up: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("↑/k", "navigate up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("↓/j", "navigate down"),
	),
	Select: key.NewBinding(
		key.WithKeys("enter", " "),
		key.WithHelp("enter/space", "select"),
	),
}

Functions

func InitialModel

func InitialModel() model

Types

type KeyMap

type KeyMap struct {
	Quit   key.Binding
	Up     key.Binding
	Down   key.Binding
	Select key.Binding
}

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) MenuKeyMap

func (k KeyMap) MenuKeyMap() help.KeyMap

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding
type MenuItem int
const (
	MenuStart MenuItem = iota
	MenuConfig
	MenuExit
)

func RunMenu

func RunMenu() MenuItem

Jump to

Keyboard shortcuts

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