ui

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 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 (
	Teal    = lipgloss.Color("#2DD4BF")
	Cyan    = lipgloss.Color("#22D3EE")
	Green   = lipgloss.Color("#4ADE80")
	Red     = lipgloss.Color("#F87171")
	Yellow  = lipgloss.Color("#FBBF24")
	Dim     = lipgloss.Color("#6B7280")
	White   = lipgloss.Color("#F9FAFB")
	DimText = lipgloss.Color("#9CA3AF")
)

Brand colors

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

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

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

	WarningStyle = lipgloss.NewStyle().
					Foreground(Yellow).
					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(Teal).
				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