table

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package table demonstrates pkg/table — a filterable cursor-driven tabular view with a sticky header. Cells use ansi.CellColor for the status column so the selected-row background passes through unbroken across colored cells.

Column sizing modes shown side-by-side:

  • City — Flex: 1, MaxWidth: 28. Expands to absorb leftover space up to a cap so it doesn't grow unboundedly on wide terminals. Resize and watch the column stretch up to 28 then stop.
  • Region — Width: 16, classic fixed width.
  • Population — Width: 12, fixed width (right-aligned).
  • Status — Width: 0, content-auto. Sizes to the widest cell value (here "● degraded" with ANSI stripped) plus the title floor.

The Wiki column wraps each city's Wikipedia URL in an OSC 8 hyperlink via ansi.Hyperlink. The visible label ("wiki ↗") is short so it never truncates, but even on a column squeezed to "wi" the underlying URL is intact — shift-click in alacritty/tmux/kitty launches the full Wikipedia page in the browser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

Types

type Screen

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

func (*Screen) Help

func (s *Screen) Help() []key.Binding

func (*Screen) Init

func (s *Screen) Init() tea.Cmd

func (*Screen) IsCapturingKeys

func (s *Screen) IsCapturingKeys() bool

func (*Screen) Layout

func (s *Screen) Layout() layout.Node

func (*Screen) OnEnter

func (s *Screen) OnEnter(any) tea.Cmd

func (*Screen) SetTheme

func (s *Screen) SetTheme(t theme.Theme)

func (*Screen) Title

func (s *Screen) Title() string

func (*Screen) Update

func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)

Jump to

Keyboard shortcuts

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