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 ¶
- func New(t theme.Theme) screen.Screen
- type Screen
- func (s *Screen) Help() []key.Binding
- func (s *Screen) Init() tea.Cmd
- func (s *Screen) IsCapturingKeys() bool
- func (s *Screen) Layout() layout.Node
- func (s *Screen) OnEnter(any) tea.Cmd
- func (s *Screen) SetTheme(t theme.Theme)
- func (s *Screen) Title() string
- func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
func (*Screen) IsCapturingKeys ¶
Click to show internal directories.
Click to hide internal directories.