Skip to content

Theme the output

The progress-family renderers (Status, Progress, Spin) draw their icons, colours, spinner frames and bar runes from a Theme. Override it with WithTheme to match your tool's palette.

The default

DefaultTheme() provides check / warning / cross icons, a magenta braille spinner, and an ASCII progress bar:

r := output.New() // uses DefaultTheme()

A custom theme

Start from the default and change only what you need:

th := output.DefaultTheme()
th.SuccessIcon = "✔"
th.FailIcon = "✖"
th.SpinnerFrames = []string{"◐", "◓", "◑", "◒"}
th.ProgressFilled = '█'
th.ProgressEmpty = '░'
th.ProgressHead = 0 // 0 → reuse ProgressFilled for the leading edge

r := output.New(output.WithWriter(os.Stderr), output.WithTheme(th))

Theme fields

Field Used by
SuccessIcon / WarnIcon / FailIcon Status.Success / .Warn / .Fail
SuccessStyle / WarnStyle / FailStyle the lipgloss style of the finalised line
SpinnerStyle spinner frames (Spin, and Status.Update)
SpinnerFrames the animation frame set (empty → falls back to the built-in dot)
ProgressFilled / ProgressEmpty / ProgressHead the progress-bar runes

Styles are lipgloss.Style values, so any lipgloss styling (foreground, background, bold, …) applies. Colours only render when the renderer is interactive; under CI the icons print without ANSI styling.