tui

package
v0.26041.1000-preview Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCancelled = errors.New("cancelled")
	ErrBack      = errors.New("back")
)

Common errors

Functions

func RunProgram

func RunProgram(m tea.Model) (tea.Model, error)

RunProgram is a helper to run a tea program and handle cancellation

Types

type Action

type Action int

Action represents user's navigation action

const (
	ActionConfirm Action = iota // User confirmed selection/input
	ActionBack                  // User pressed back/escape
	ActionCancel                // User cancelled (Ctrl+C)
)

type Result

type Result[T any] struct {
	Value  T
	Action Action
}

Result wraps component output with navigation context

func (Result[T]) IsBack

func (r Result[T]) IsBack() bool

IsBack returns true if user went back

func (Result[T]) IsCancel

func (r Result[T]) IsCancel() bool

IsCancel returns true if user cancelled

func (Result[T]) IsConfirm

func (r Result[T]) IsConfirm() bool

IsConfirm returns true if user confirmed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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