tui

package
v3.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIAccent      = "#5EB8FF"
	CLIBrightWhite = "#FFFFFF"
	CLIText        = "#CED1D7"
	CLITextMuted   = "#989EA8"
	CLITextSubtle  = "#848892"
	CLIBorder      = "#343A47"
	CLIBgElevated  = "#1A1B1E"
	CLIError       = "#FF7870"
	CLISuccess     = "#5DE28D"
	CLIWarning     = "#FFC833"
)

Harness CLI terminal palette — fixed dark theme (docs/design-system.md).

View Source
const GutterWidth = 2

GutterWidth is the reserved left gutter: "▶ " or " ".

Variables

This section is empty.

Functions

func TruncateANSI

func TruncateANSI(s string, n int) string

TruncateANSI keeps the first n visible runes of s, preserving ANSI codes.

Types

type Column

type Column struct {
	Header string
	Width  int
}

Column defines a table column header and its display width.

type Row

type Row []string

Row is a slice of cell strings, one per column.

type TableModel

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

TableModel is a bubbletea-compatible table with a custom renderer. It owns cursor/scroll state and supports colored cell values.

func NewTable

func NewTable(columns []Column, height, width int) TableModel

NewTable creates a TableModel with sensible defaults.

func (*TableModel) Cursor

func (t *TableModel) Cursor() int

func (*TableModel) GotoTop

func (t *TableModel) GotoTop()

func (TableModel) HeaderView

func (t TableModel) HeaderView() string

HeaderView returns just the header row (same styling as View).

func (*TableModel) Rows

func (t *TableModel) Rows() []Row

func (*TableModel) SetColumns

func (t *TableModel) SetColumns(cols []Column)

func (*TableModel) SetCursor

func (t *TableModel) SetCursor(row int)

SetCursor moves the cursor to row, clamped to [0, len(rows)-1] (or 0 when there are no rows), and scrolls it into view.

func (*TableModel) SetHeight

func (t *TableModel) SetHeight(h int)

func (*TableModel) SetRows

func (t *TableModel) SetRows(rows []Row)

func (*TableModel) SetWidth

func (t *TableModel) SetWidth(w int)

func (TableModel) Update

func (t TableModel) Update(msg tea.Msg) (TableModel, tea.Cmd)

func (TableModel) View

func (t TableModel) View() string

Jump to

Keyboard shortcuts

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