ui

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ui provides centralized styling and output helpers for the CLI.

Uses charmbracelet/lipgloss for styled terminal output. All commands import this package for consistent branding.

Index

Constants

This section is empty.

Variables

View Source
var (
	PrimaryColor = lipgloss.Color("#7DD3FC") // Sky Blue
	Secondary    = lipgloss.Color("#BAE6FD") // Light Sky Blue
	SuccessColor = lipgloss.Color("#34D399") // Emerald
	ErrorColor   = lipgloss.Color("#FB7185") // Rose
	WarningColor = lipgloss.Color("#FCD34D") // Soft Amber
	Dim          = lipgloss.Color("#71717A") // Zinc 500 (Clean grey)
	White        = lipgloss.Color("#F4F4F5") // Zinc 100
	DimText      = lipgloss.Color("#A1A1AA") // Zinc 400
	FaintBorder  = lipgloss.Color("#27272A") // Zinc 800 (Faint Border)
)

Brand colors

View Source
var (
	BrandStyle = lipgloss.NewStyle().
				Foreground(PrimaryColor).
				Bold(true)

	SuccessStyle = lipgloss.NewStyle().
					Foreground(SuccessColor).
					Bold(true)

	ErrorStyle = lipgloss.NewStyle().
				Foreground(ErrorColor).
				Bold(true)

	WarningStyle = lipgloss.NewStyle().
					Foreground(WarningColor).
					Bold(true)

	DimStyle = lipgloss.NewStyle().
				Foreground(Dim)

	LabelStyle = lipgloss.NewStyle().
				Foreground(DimText)

	ValueStyle = lipgloss.NewStyle().
				Foreground(White).
				Bold(true)

	// Banner for init/welcome screens
	BannerStyle = lipgloss.NewStyle().
				Foreground(PrimaryColor).
				Bold(true).
				MarginBottom(1)

	// Status key-value pair styling
	KeyStyle = lipgloss.NewStyle().
				Foreground(DimText).
				Width(20)

	ValStyle = lipgloss.NewStyle().
				Foreground(White)

	// Divider
	DividerStyle = lipgloss.NewStyle().
					Foreground(Dim)
)

Reusable styles

Functions

func Banner(text string)

Banner prints a styled banner heading.

func BannerStr

func BannerStr(text string) string

BannerStr returns a styled banner heading as a string.

func Brand

func Brand(msg string) string

Brand prints text in the brand teal color.

func Divider

func Divider()

Divider prints a styled horizontal line.

func Error

func Error(msg string)

Error prints a red error message with an X.

func Info

func Info(msg string)

Info prints a dimmed info message.

func RenderTable

func RenderTable(headers []string, rows [][]string) string

RenderTable returns a styled table as a string.

func Spinner

func Spinner(title string, fn func() error) error

Spinner runs fn inside a spinner with the given title. Returns any error from fn, or from the spinner itself.

func StatusRow

func StatusRow(key, value string)

StatusRow prints a key-value pair for status output.

func StatusRowDim

func StatusRowDim(key, value string)

StatusRowDim prints a key-value pair with dimmed value.

func Success

func Success(msg string)

Success prints a green success message with a checkmark.

func Warning

func Warning(msg string)

Warning prints a yellow warning message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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