tableview

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxColumnWidth caps how wide a column can be.
	MaxColumnWidth = 100
	// MinTableHeightRows ensures the viewport is never too small to render properly.
	MinTableHeightRows = 2
)

Variables

View Source
var (
	// ErrNoColumns indicates there were no columns to display.
	ErrNoColumns = eris.New("no columns to display")
)

Functions

func Run

func Run(
	columns []string,
	rows [][]string,
) error

Run executes the read-only table UI.

Types

type Model

type Model struct {
	Columns []string   // headers
	Rows    [][]string // cells per row
	// contains filtered or unexported fields
}

Model represents the UI state for a read-only table view.

func InitialModel

func InitialModel(columns []string, rows [][]string) *Model

InitialModel creates a new Model with the given columns and rows.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the bubbletea model and schedules a quit on the next tick to allow one render.

func (*Model) Update

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

Update exits immediately on context cancellation or after the first tick.

func (*Model) View

func (m *Model) View() string

View renders the current state of the table.

Jump to

Keyboard shortcuts

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