components

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package components provides reusable TUI components.

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.

type InfoDialog added in v0.32.0

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

InfoDialog displays structured, optionally status-annotated information.

func NewInfoDialog added in v0.32.0

func NewInfoDialog(title string, sections []InfoSection, footer, helpText string, width, height int) *InfoDialog

NewInfoDialog creates a new info dialog.

func (*InfoDialog) Overlay added in v0.32.0

func (d *InfoDialog) Overlay(background string, width, height int) string

Overlay renders the dialog centered over the provided background.

func (*InfoDialog) ScrollDown added in v0.32.0

func (d *InfoDialog) ScrollDown()

ScrollDown scrolls the viewport down.

func (*InfoDialog) ScrollUp added in v0.32.0

func (d *InfoDialog) ScrollUp()

ScrollUp scrolls the viewport up.

type InfoItem added in v0.32.0

type InfoItem struct {
	Label  string
	Value  string
	Status InfoStatus
}

InfoItem is a single labeled row in an info section.

type InfoSection added in v0.32.0

type InfoSection struct {
	Title string
	Items []InfoItem
}

InfoSection groups related info items under a section title.

type InfoStatus added in v0.32.0

type InfoStatus int

InfoStatus represents the status of an info item.

const (
	InfoStatusNone InfoStatus = iota
	InfoStatusPass
	InfoStatusWarn
	InfoStatusFail
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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