spinner

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package spinner exposes reusable UTF-8 spinner frame sets sourced from github.com/kojix2/spinner2.

The package intentionally stays low-level: callers work directly with named frame sets and build any title, border, or overlay behavior outward from those primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Names

func Names() []string

Names returns the stable spinner names in sorted order.

Types

type Spinner

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

Spinner is a reusable animation sequence.

func All

func All() []Spinner

All returns every spinner in sorted name order.

func Lookup

func Lookup(name string) (Spinner, bool)

Lookup returns a spinner by name.

func Must

func Must(name string) Spinner

Must returns a spinner by name and panics if it doesn't exist.

func (Spinner) DecorateLeft

func (s Spinner) DecorateLeft(label string, step int) string

DecorateLeft prefixes the current frame to a label.

func (Spinner) DecorateRight

func (s Spinner) DecorateRight(label string, step int) string

DecorateRight appends the current frame to a label.

func (Spinner) Frame

func (s Spinner) Frame(step int) string

Frame returns the string frame for the requested step.

func (Spinner) Frames

func (s Spinner) Frames() []string

Frames returns a copy of the spinner's frame set.

func (Spinner) Interval

func (s Spinner) Interval() int

Interval returns the upstream spinner interval.

func (Spinner) Name

func (s Spinner) Name() string

Name returns the stable spinner name.

func (Spinner) Rune

func (s Spinner) Rune(step int) (rune, bool)

Rune returns the rune for the requested step when the spinner is single-cell.

func (Spinner) RuneFrames

func (s Spinner) RuneFrames() ([]rune, bool)

RuneFrames converts the spinner into single-cell runes when possible.

func (Spinner) SingleCell

func (s Spinner) SingleCell() bool

SingleCell reports whether every frame occupies exactly one cell.

Jump to

Keyboard shortcuts

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