spinner

package
v1.44.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package spinner provides a simple terminal spinner backed by Bubble Tea.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spinner

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

Spinner runs a spinner animation while a function executes, then prints a final message when done. Use New to create one, configure with With* methods, and call Run to execute.

func New

func New() *Spinner

New returns a Spinner with sensible defaults writing to stderr.

func (*Spinner) Run

func (s *Spinner) Run(fn func() error) error

Run executes fn, showing the spinner while it runs. The spinner is skipped when disabled or when the output is not a TTY. Returns any error from fn.

func (*Spinner) WithDisabled

func (s *Spinner) WithDisabled(v bool) *Spinner

WithDisabled disables the spinner entirely when v is true. fn still runs, but no animation or final message is shown.

func (*Spinner) WithFinalMsg

func (s *Spinner) WithFinalMsg(msg string) *Spinner

WithFinalMsg sets the line printed after fn completes.

func (*Spinner) WithLabel

func (s *Spinner) WithLabel(label string) *Spinner

WithLabel sets the text shown next to the spinner frame.

func (*Spinner) WithOutput

func (s *Spinner) WithOutput(w io.Writer) *Spinner

WithOutput sets the writer the spinner renders to (default: os.Stderr).

func (*Spinner) WithStyle

func (s *Spinner) WithStyle(style lipgloss.Style) *Spinner

WithStyle sets the lipgloss style applied to the spinner frame.

Jump to

Keyboard shortcuts

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