components

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package components provides reusable TUI components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pad

func Pad(n int) string

Pad returns a string of n spaces, using a cache for efficiency.

Types

type ConfirmModal

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

ConfirmModal is a simple yes/no confirmation dialog.

func NewConfirmModal

func NewConfirmModal(message string) ConfirmModal

NewConfirmModal creates a new confirmation modal.

func (ConfirmModal) Cancelled

func (m ConfirmModal) Cancelled() bool

Cancelled returns true if user cancelled.

func (ConfirmModal) Confirmed

func (m ConfirmModal) Confirmed() bool

Confirmed returns true if user confirmed.

func (ConfirmModal) Update

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

Update handles input for the confirmation modal.

func (ConfirmModal) View

func (m ConfirmModal) View() string

View renders the confirmation modal.

type HelpDialog

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

HelpDialog displays all available keyboard shortcuts.

func NewHelpDialog

func NewHelpDialog(title string, sections []HelpDialogSection, width, height int) *HelpDialog

NewHelpDialog creates a new help dialog with the given sections.

func (*HelpDialog) Overlay

func (h *HelpDialog) Overlay(background string, width, height int) string

Overlay renders the help dialog as a layer over the given background.

func (*HelpDialog) View

func (h *HelpDialog) View() string

View renders the help dialog.

type HelpDialogSection

type HelpDialogSection struct {
	Title   string
	Entries []HelpEntry
}

HelpDialogSection groups related help entries under a title.

type HelpEntry

type HelpEntry struct {
	Key  string
	Desc string
}

HelpEntry represents a single keyboard shortcut entry.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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