Help us shape the future of Go! Take the 2026 Go Developer Survey

ui

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ui provides shared lipgloss styles and output formatting helpers.

Index

Constants

View Source
const (
	SymOK      = "✓"
	SymWarn    = "⚠"
	SymFail    = "!"
	SymUp      = "↑"
	SymLink    = "→"
	SymBusy    = "~" // in-progress indicator for the progress bar
	SymSkipped = "ø" // slot exists but was structurally skipped (e.g. no remote)
)

Symbols used in status output.

Variables

View Source
var (
	OK     = lipgloss.NewStyle().Foreground(lipgloss.Color("2")) // green
	Warn   = lipgloss.NewStyle().Foreground(lipgloss.Color("3")) // yellow
	Fail   = lipgloss.NewStyle().Foreground(lipgloss.Color("1")) // red
	Muted  = lipgloss.NewStyle().Foreground(lipgloss.Color("8")) // bright black / grey
	Bold   = lipgloss.NewStyle().Bold(true)
	Header = Muted.Bold(true)
)

Styles.

Functions

func SectionHeader

func SectionHeader(label string) string

SectionHeader renders a bold+muted label followed by a muted trailing rule, e.g. "REPOS ────────────────────────────".

Types

type Table

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

Table is an ANSI-aware columnar writer. Call Row for each line, then Flush. Columns are padded to the widest value using lipgloss's table package, which measures visual width rather than byte length so styled cells align correctly.

func NewTableWriter

func NewTableWriter(w io.Writer) *Table

NewTableWriter returns a Table writing to w.

func (*Table) Flush

func (t *Table) Flush()

Flush finalises the table alignment and writes all output.

func (*Table) Row

func (t *Table) Row(fields ...string)

Row writes one row. Fields are padded per-column for alignment.

Jump to

Keyboard shortcuts

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