tui

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	// Navigation
	Up   key.Binding
	Down key.Binding

	// Selection
	Select key.Binding

	// Emacs-style cursor movement
	CursorStart   key.Binding
	CursorEnd     key.Binding
	CursorBack    key.Binding
	CursorForward key.Binding

	// Emacs-style editing
	DeleteWordBack key.Binding
	KillLine       key.Binding

	// Actions
	ToggleDelete key.Binding
	Rename       key.Binding
	Create       key.Binding
	Help         key.Binding

	// General
	Cancel    key.Binding
	Backspace key.Binding
}

KeyMap contains all key bindings for the TUI

func NewKeyMap

func NewKeyMap() KeyMap

NewKeyMap creates a new KeyMap with default bindings

func (KeyMap) FullHelp

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

FullHelp returns a full help string for the current mode

func (KeyMap) ShortHelp

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

ShortHelp returns a short help string for the current mode

type Mode

type Mode int

Mode represents the current mode of the TUI

const (
	ModeNormal Mode = iota
	ModeDelete
	ModeRename
	ModeCreate
	ModeConfirmDelete
)

func (Mode) String

func (m Mode) String() string

String returns a human-readable string for the mode

type Model

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

Model represents the state of the Bubble Tea application

func New

func New(manager *tries.Manager) Model

New creates a new TUI model with the given manager

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model and loads entries

func (Model) OutputCommand

func (m Model) OutputCommand() string

OutputCommand returns the command to output on exit

func (Model) ShouldExit

func (m Model) ShouldExit() bool

ShouldExit returns whether the TUI should exit

func (Model) Update

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

Update handles all messages and updates the model

func (Model) View

func (m Model) View() string

View renders the TUI based on current state

type Styles

type Styles struct {
	Title            lipgloss.Style
	SearchPrefix     lipgloss.Style
	SearchInput      lipgloss.Style
	SearchCursor     lipgloss.Style
	ListItem         lipgloss.Style
	ListItemSelected lipgloss.Style
	ListItemMarked   lipgloss.Style
	DatePrefix       lipgloss.Style
	HelpText         lipgloss.Style
	StatusBar        lipgloss.Style
	StatusMessage    lipgloss.Style
	ErrorMessage     lipgloss.Style
	SuccessMessage   lipgloss.Style
	Prompt           lipgloss.Style
	PromptInput      lipgloss.Style
	Muted            lipgloss.Style
	GitBranch        lipgloss.Style
	GitAhead         lipgloss.Style
	GitBehind        lipgloss.Style
	GitDirty         lipgloss.Style
	ColumnHeader     lipgloss.Style
}

Styles contains all the lipgloss styles for the TUI

func NewStyles

func NewStyles() Styles

NewStyles creates a new Styles instance with default styling

Jump to

Keyboard shortcuts

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