spinner

package module
v0.0.0-...-40d2b68 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: MIT Imports: 9 Imported by: 157

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Line      = Type(spinner.Line)
	Dots      = Type(spinner.Dot)
	MiniDot   = Type(spinner.MiniDot)
	Jump      = Type(spinner.Jump)
	Points    = Type(spinner.Points)
	Pulse     = Type(spinner.Pulse)
	Globe     = Type(spinner.Globe)
	Moon      = Type(spinner.Moon)
	Monkey    = Type(spinner.Monkey)
	Meter     = Type(spinner.Meter)
	Hamburger = Type(spinner.Hamburger)
	Ellipsis  = Type(spinner.Ellipsis)
)

Functions

This section is empty.

Types

type Spinner

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

Spinner represents a loading spinner. To get started simply create a new spinner and call `Run`.

s := spinner.New()
s.Run()

⣾ Loading...

func New

func New() *Spinner

New creates a new spinner.

func (*Spinner) Accessible

func (s *Spinner) Accessible(accessible bool) *Spinner

Accessible sets the spinner to be static.

func (*Spinner) Action

func (s *Spinner) Action(action func()) *Spinner

Action sets the action of the spinner.

func (*Spinner) ActionWithErr

func (s *Spinner) ActionWithErr(action func(context.Context) error) *Spinner

ActionWithErr sets the action of the spinner.

This is just like Spinner.Action, but allows the action to use a `context.Context` and to return an error.

func (*Spinner) Context

func (s *Spinner) Context(ctx context.Context) *Spinner

Context sets the context of the spinner.

func (*Spinner) Init

func (s *Spinner) Init() tea.Cmd

Init initializes the spinner.

func (*Spinner) Output

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

Output set the output for the spinner. Default is STDOUT when Spinner.Accessible, STDERR otherwise.

func (*Spinner) Run

func (s *Spinner) Run() error

Run runs the spinner.

func (*Spinner) Style

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

Style sets the style of the spinner.

func (*Spinner) Title

func (s *Spinner) Title(title string) *Spinner

Title sets the title of the spinner.

func (*Spinner) TitleStyle

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

TitleStyle sets the title style of the spinner.

func (*Spinner) Type

func (s *Spinner) Type(t Type) *Spinner

Type sets the type of the spinner.

func (*Spinner) Update

func (s *Spinner) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update updates the spinner.

func (*Spinner) View

func (s *Spinner) View() string

View returns the spinner view.

type Type

type Type spinner.Spinner

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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