frame

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package frame is a pure frame builder: given content, it returns one string per terminal row, each exactly `width` visible cells wide. No IO — the caller decides how to paint, and tests assert on the result.

Go port of Ruby's lib/tui/frame.rb.

Index

Constants

View Source
const Cursor = "❯ "

Cursor is the selection glyph. Deliberately distinct from the collapsed-row marker ("▸ ") so a selected collapsed row reads "❯ ▸ title", not a doubled marker. One cell plus a trailing space = two cells, matching the marker column width.

Variables

This section is empty.

Functions

func Build

func Build(opts Options) []string

Build renders the whole frame.

Types

type Options

type Options struct {
	Width, Height int
	Header        string
	Rows          []Row
	// Selected is the absolute row index to highlight, or nil.
	Selected  *int
	Footer    []layout.FooterLine
	Popup     *layout.Popup
	Panel     *Panel
	Modal     *layout.Modal
	Layout    *layout.Layout
	Theme     *theme.Theme
	Truecolor bool
	// PanelOffset is only consulted when Layout is nil.
	PanelOffset int
}

Options describes one frame.

type Panel

type Panel struct {
	Title string
	Lines []string
}

Panel is the fixed-width right pane.

type Row

type Row struct{ Text string }

Row is one list row. Text carries the row's own field styling, each field closed with a reset — the compositing contract selectedRow depends on.

Jump to

Keyboard shortcuts

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