Note: This is my first time trying the V programming language - it's quite weird, honestly! There are some bugs in this project, but I wanted to share it anyway.
A cross-platform V library for creating beautiful terminal spinner animations. Perfect for enhancing your CLI applications with engaging loading indicators.
- 🎨 30+ Built-in Spinner Styles - From simple dots to complex animations
- 🌈 Color Support - 7 different colors available
- ⚡ Cross-Platform - Works on Windows, macOS, and Linux
- 🔧 Customizable - Adjust speed, messages, and colors
- 📱 Lightweight - Zero dependencies, pure V implementation
- 🎯 Easy to Use - Simple API for quick integration
v install spinnerOr add to your v.mod:
dependencies: ['spinner']import spinner
import time
fn main() {
mut s := spinner.new_spinner(.dots)
s.set_message('Loading...')
s.set_color('green')
s.start()
time.sleep(3 * time.second)
s.finish_with_message('✓ Done!')
}| Style | Animation | Description |
|---|---|---|
dots |
⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏ | Classic braille dots |
line |
|/-\ | Simple line rotation |
circle |
◐◓◑◒ | Rotating circle |
arrow |
←↖↑↗→↘↓↙ | Rotating arrow |
bouncingbar |
[====] | Bouncing progress bar |
bouncingball |
( ● ) | Bouncing ball |
pulsing |
●◉⊙◯○ | Pulsing circle |
clock |
🕐🕑🕒🕓 | Clock animation |
earth |
🌍🌎🌏 | Rotating earth |
moon |
🌑🌒🌓🌔🌕 | Moon phases |
runner |
🚶🏃 | Running person |
pong |
▐⠂ ▌ | Pong game |
shark |
▐|\____________▌ | Swimming shark |
weather |
☀️🌤⛅️🌧 | Weather changes |
mindblown |
😐😮🤯💥 | Mind blown sequence |
soccerHeader |
⚽️🧑 | Soccer header |
timeTravel |
🕐🕛🕧 | Time travel effect |
aesthetic |
▰▰▰▰▰▰▰ | Aesthetic progress |
spinner.new_spinner(style SpinnerStyle) Spinnerset_message(message string) // Set spinner message
set_color(color string) // Set spinner color
set_delay(delay time.Duration) // Set animation speedstart() // Start the spinner
stop() // Stop the spinner
finish_with_message(msg string) // Stop with final message
update_message(msg string) // Update message while runningredgreenyellowbluemagentacyanwhite
import spinner
import time
mut s := spinner.new_spinner(.dots)
s.set_message('Processing...')
s.start()
time.sleep(2 * time.second)
s.stop()mut s := spinner.new_spinner(.circle)
s.set_message('Downloading...')
s.set_color('blue')
s.start()
time.sleep(3 * time.second)
s.finish_with_message('✓ Download complete!')mut s := spinner.new_spinner(.bouncingball)
s.set_message('Initializing...')
s.start()
time.sleep(1 * time.second)
s.update_message('Connecting...')
time.sleep(1 * time.second)
s.update_message('Loading data...')
time.sleep(1 * time.second)
s.finish_with_message('✓ Ready!')mut s := spinner.new_spinner(.aesthetic)
s.set_delay(50 * time.millisecond) // Faster animation
s.set_message('Fast loading...')
s.start()
time.sleep(2 * time.second)
s.stop()v run example.vThis will demonstrate various spinner styles and configurations.
The library uses ANSI escape sequences for cursor control and colors, making it compatible with:
- Linux - All major distributions
- macOS - Terminal.app, iTerm2, and others
- Windows - Windows Terminal, PowerShell, CMD (Windows 10+)
Contributions are welcome! Feel free to:
- Add new spinner styles
- Improve cross-platform compatibility
- Fix bugs or enhance performance
- Improve documentation
MIT License - see LICENSE file for details.
Inspired by similar spinner libraries in other languages, bringing beautiful terminal animations to the V ecosystem.