Documentation
¶
Overview ¶
Package spinner provides a simple terminal spinner backed by Bubble Tea.
Index ¶
- type Spinner
- func (s *Spinner) Run(fn func() error) error
- func (s *Spinner) WithDisabled(v bool) *Spinner
- func (s *Spinner) WithFinalMsg(msg string) *Spinner
- func (s *Spinner) WithLabel(label string) *Spinner
- func (s *Spinner) WithOutput(w io.Writer) *Spinner
- func (s *Spinner) WithStyle(style lipgloss.Style) *Spinner
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 (*Spinner) Run ¶
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 ¶
WithDisabled disables the spinner entirely when v is true. fn still runs, but no animation or final message is shown.
func (*Spinner) WithFinalMsg ¶
WithFinalMsg sets the line printed after fn completes.
func (*Spinner) WithOutput ¶
WithOutput sets the writer the spinner renders to (default: os.Stderr).