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 ¶
- Variables
- func Banner(text string)
- func BannerStr(text string) string
- func Brand(msg string) string
- func Divider()
- func Error(msg string)
- func Info(msg string)
- func RenderTable(headers []string, rows [][]string) string
- func Spinner(title string, fn func() error) error
- func StatusRow(key, value string)
- func StatusRowDim(key, value string)
- func Success(msg string)
- func Warning(msg string)
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 RenderTable ¶
RenderTable returns a styled table as a string.
func Spinner ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.