Help us shape the future of Go! Take the 2026 Go Developer Survey

ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

internal/ui/menu.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Footer(styles Styles, activeSection int, width int) string

func GetPolicyStyle

func GetPolicyStyle(styles Styles, policy string) lipgloss.Style

func InsertCursor

func InsertCursor(line string, selected bool, styles Styles) string

func InsertCursorRulesSection

func InsertCursorRulesSection(line string, selected bool, styles Styles, action string) string

func TitledBox

func TitledBox(title, content string, styles Styles, width int, activeSession bool, height ...int) string

Types

type Menu struct {
	Options  []MenuItem
	Selected int
	// contains filtered or unexported fields
}

func NewMenu

func NewMenu(options []MenuItem, styles Styles) Menu
func (m *Menu) Down()
func (m Menu) ExecuteSelected() tea.Cmd
func (m *Menu) Up()
func (m *Menu) Update(msg tea.Msg) bool
func (m Menu) View(styles Styles) string
type MenuItem struct {
	Label  string
	Action func() tea.Cmd
}

func MakeMenuItems

func MakeMenuItems(labels []string, handler func(string) tea.Cmd) []MenuItem

type Styles

type Styles struct {
	Title    lipgloss.Style
	Subtitle lipgloss.Style

	ActiveStatus   lipgloss.Style
	InactiveStatus lipgloss.Style
	StatusLabel    lipgloss.Style

	SectionBorder       lipgloss.Style
	SectionTitle        lipgloss.Style
	SectionBorderActive lipgloss.Style

	ActiveCursorPointer lipgloss.Style

	Menu lipgloss.Style

	AllowPolicy  lipgloss.Style
	DenyPolicy   lipgloss.Style
	RejectPolicy lipgloss.Style

	Label lipgloss.Style
	Value lipgloss.Style

	Footer    lipgloss.Style
	FooterKey lipgloss.Style

	Error lipgloss.Style
}

func NewStyles

func NewStyles() Styles

Jump to

Keyboard shortcuts

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