Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 1.85 KB

README.md

File metadata and controls

67 lines (48 loc) · 1.85 KB
Rotato Logo

🌀 Rotato

GitHub go.mod Go version Linux Go Reference

Lightweight and highly customizable spinner library for Go, designed to enhance your command-line applications with visually appealing progress indicators. With 42 spinners to choose from, you can easily integrate dynamic loading animations into your projects.


Demo

🎬 More demos

You can check out the spinners with the following commands:

# simple demo.
go run github.com/haaag/rotato/example@latest -demo

# all registered rotatos.
go run github.com/haaag/rotato/example@latest -all

📦 Installation

go get github.com/haaag/rotato@latest

🚀 Example

There is a example in the example folder.

r := rotato.New(
    rotato.WithPrefix("Repo"),
    rotato.WithSpinnerColor(rotato.ColorBrightGreen),
    rotato.WithDoneColorMesg(rotato.ColorBrightGreen, rotato.ColorStyleItalic),
    rotato.WithFailColorMesg(rotato.ColorRed, rotato.ColorStyleBlink),
)
r.Start()
// do some stuff
repo := git.New("https://github.com/haaag/rotato")
r.UpdateMesg("Syncing Repo...")
if err := repo.Sync(); err != nil {
    r.Fail("Sync Failed!")
    return err
}
r.Done("Sync Completed!")

🗨️ Credits

This package uses symbols/spinners from this libraries, and of course ideas!

Thanks to: