{"id":17967211,"url":"https://github.com/kei-k23/spinix","last_synced_at":"2025-08-16T15:31:57.744Z","repository":{"id":259674920,"uuid":"878956543","full_name":"Kei-K23/spinix","owner":"Kei-K23","description":"Spinix 🌀 is a Go package that provides terminal-based highly customizable and performance loading animations, including spinners and progress bars.","archived":false,"fork":false,"pushed_at":"2024-11-25T05:13:54.000Z","size":111,"stargazers_count":18,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-17T00:13:45.523Z","etag":null,"topics":["cli","go","lib","library","progress-bar","spinner","terminal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kei-K23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-26T15:16:51.000Z","updated_at":"2024-11-28T18:20:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"9157c21f-3cc2-4c66-a05d-141cf5795d55","html_url":"https://github.com/Kei-K23/spinix","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.0357142857142857,"last_synced_commit":"31606d5c2883861aaafa0c654ffead27caf5f73a"},"previous_names":["kei-k23/spinix"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fspinix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fspinix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fspinix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kei-K23%2Fspinix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kei-K23","download_url":"https://codeload.github.com/Kei-K23/spinix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230043147,"owners_count":18163966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","go","lib","library","progress-bar","spinner","terminal"],"created_at":"2024-10-29T14:04:40.427Z","updated_at":"2024-12-17T00:13:53.659Z","avatar_url":"https://github.com/Kei-K23.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spinix\n\n[![Go Test](https://github.com/Kei-K23/spinix/actions/workflows/test.yml/badge.svg)](https://github.com/Kei-K23/spinix/actions/workflows/test.yml)\n\n**Spinix** 🌀 is a **Go package** that provides terminal-based loading animations, including spinners and progress bars. It supports customizable themes, colors, and speeds, allowing developers to create visually appealing loading indicators that can fit various terminal environments and aesthetics.\n\n## Features\n\n- **Spinners**: Multiple spinner styles with customizable speed and colors.\n- **Progress Bars**: A customizable progress bar with adjustable width, characters, and styles.\n- **Thread Safety**: Safe to use in concurrent environments with mutexes.\n- **Customizable Themes**: Use predefined themes or create your own custom spinner themes.\n\n## Installation\n\nTo install **Spinix**, use `go get`:\n\n```bash\ngo get github.com/Kei-K23/spinix\n```\n\n## Usage\n\n### Spinners\n\nHere’s how to create and use a spinner:\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\t\"github.com/Kei-K23/spinix\"\n)\n\nfunc main() {\n\tspinner := spinix.NewSpinner().\n\t\tSetSpinnerColor(\"\\033[34m\").\n\t\tSetMessage(\"Loading...\").\n\t\tSetMessageColor(\"\\033[36m\").\n\t\tSetSpeed(100 * time.Millisecond) // Adjust speed if necessary\n\n\tspinner.Start()\n\n\t// Simulate some work\n\ttime.Sleep(5 * time.Second)\n\n\tspinner.Stop()\n\n    // spinix.NewSpinner() will also create spinner with default properties\n    // e.g\n    // spinner := spinix.NewSpinner()\n\t// spinner.Start()\n\t// time.Sleep(5 * time.Second)\n\t// spinner.Stop()\n}\n\n```\n\n### Progress Bars\n\nCreating and using a progress bar is just as straightforward:\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\t\"github.com/Kei-K23/spinix\"\n)\n\nfunc main() {\n\tprogressBar := spinix.NewProgressBar().\n\t\tSetWidth(50).\n\t\tSetColor(\"\\033[32m\").\n\t\tSetLabel(\"Progress:\")\n\n\tprogressBar.Start()\n\n\tfor i := 0; i \u003c= 100; i++ {\n\t\tprogressBar.Update(i)\n\t\ttime.Sleep(50 * time.Millisecond) // Simulate work\n\t}\n\n\tprogressBar.Stop()\n\n    // spinix.NewProgressBar() will also create progress bar with default properties.\n    // e.g\n    // progressBar := spinix.NewProgressBar()\n    // progressBar.Start()\n\t// for i := 0; i \u003c= 100; i++ {\n\t// \tprogressBar.Update(i)\n\t// \ttime.Sleep(50 * time.Millisecond) // Simulate work\n\t// }\n\t// progressBar.Stop()\n}\n```\n\n## Customization\n\n### Spinners\n\nYou can customize the spinner's message, colors, speed, theme and define a custom callback function that will run once the and spinner is completed:\n\n```go\nfunc main() {\n\tspinner := spinix.NewSpinner().\n\t\tSetMessage(\"Processing...\").\n\t\tSetMessageColor(\"\\033[33m\").\n\t\tSetCustomTheme([]string{\"▁\", \"▃\", \"▄\", \"▅\", \"▆\", \"▇\", \"█\", \"▇\", \"▆\", \"▅\", \"▄\", \"▃\"}).\n\t\tSetSpinnerColor(\"\\033[31m\"). // Red color (you can use every color you want with that format but spinner color will not work with emoji spinner)\n\t\tSetSpeed(200 * time.Millisecond).\n\t\tSetCallback(func() {\n\t\t\tfmt.Println(\"The callback function has executed!\")\n\t\t})\n\n\tspinner.Start()\n\ttime.Sleep(2 * time.Second) // Simulate a task\n\tspinner.Stop()\n}\n```\n\n### Progress Bars\n\nYou can customize the progress bar's message, width, color, appearance and define a custom callback function that will run once the and progress bar is completed:\n\n```go\nfunc main() {\n\tprogressBar := spinix.NewProgressBar().\n\t\tSetWidth(60).\n\t\tSetBarChar(\"█\").\n\t\tSetEmptyChar(\"░\").\n\t\tSetBorders(\"[\", \"]\").\n\t\tSetShowPercentage(true).\n\t\tSetCallback(func() {\n\t\t\tfmt.Println(\"The callback function has executed!\")\n\t\t})\n\n\tprogressBar.Start()\n\n\tfor i := 0; i \u003c= 100; i++ {\n\t\tprogressBar.Update(i)\n\t\ttime.Sleep(50 * time.Millisecond) // Simulate work\n\t}\n\n\tprogressBar.Stop()\n}\n```\n\n## Use Predefined Spinner and Progress bar\n\n### Spinners\n\nYou can also use predefined spinner themes that provided by **spinix**:\nSee all available predefined spinner themes below\n\n```go\nfunc main() {\n\tspinner := spinix.NewSpinner().\n\t\tSetMessage(\"Processing...\").\n\t\tSetMessageColor(\"\\033[33m\").\n\t\tSetTheme(spinix.SpinnerRotatingArrow)\n\n\tspinner.Start()\n\n\t// Simulate some work\n\ttime.Sleep(5 * time.Second)\n\n\tspinner.Stop()\n}\n```\n\n### Progress Bars\n\nYou can use predefined progress bar style that provided by **spinix**:\nSee all available predefined progress bar styles below\n\n```go\nfunc main() {\n\tprogressBar := spinix.NewProgressBar().\n\t\tSetStyle(spinix.PbStyleBasic).\n\t\tSetShowPercentage(true)\n\n\tprogressBar.Start()\n\n\tfor i := 0; i \u003c= 100; i++ {\n\t\tprogressBar.Update(i)\n\t\ttime.Sleep(50 * time.Millisecond) // Simulate work\n\t}\n\n\tprogressBar.Stop()\n}\n```\n\n## Available Spinner Themes\n\nThe **Spinix** package comes with several predefined spinner themes. Here’s a list of the available styles along with their visualizations:\n\n| Spinner Theme            | Visualization                                |\n| ------------------------ | -------------------------------------------- |\n| **SpinnerClassicDots**   | ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏                          |\n| **SpinnerLineTheme**     | - \\                                          |\n| **SpinnerPulsatingDot**  | ⠁ ⠂ ⠄ ⠂                                      |\n| **SpinnerGrowingBlock**  | ▁ ▃ ▄ ▅ ▆ ▇ █ ▇ ▆ ▅ ▄ ▃                      |\n| **SpinnerRotatingArrow** | → ↘ ↓ ↙ ← ↖ ↑ ↗                              |\n| **SpinnerArcLoader**     | ◜ ◠ ◝ ◞ ◡ ◟                                  |\n| **SpinnerClock**         | 🕛 🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚          |\n| **SpinnerCircleDots**    | ◐ ◓ ◑ ◒                                      |\n| **SpinnerBouncingBall**  | ⠁ ⠂ ⠄ ⠂                                      |\n| **SpinnerFadingSquares** | ▖ ▘ ▝ ▗                                      |\n| **SpinnerDotsFading**    | ⠁ ⠂ ⠄ ⠂ ⠁ ⠂ ⠄ ⠂                              |\n| **SpinnerEarth**         | 🌍 🌎 🌏                                     |\n| **SpinnerSnake**         | ⠈ ⠐ ⠠ ⢀ ⡀ ⠄ ⠂ ⠁                              |\n| **SpinnerTriangle**      | ◢ ◣ ◤ ◥                                      |\n| **SpinnerSpiral**        | ▖ ▘ ▝ ▗ ▘ ▝ ▖ ▗                              |\n| **SpinnerWave**          | ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▇ ▆ ▅ ▄ ▃ ▂ ▁                |\n| **SpinnerWeather**       | 🌤️ ⛅ 🌥️ ☁️ 🌧️ ⛈️ 🌩️ 🌨️                      |\n| **SpinnerRunningPerson** | 🏃💨 🏃💨💨 🏃💨💨💨 🏃‍♂️💨 🏃‍♂️💨💨 🏃‍♀️💨 🏃‍♀️💨💨 |\n| **SpinnerRunningCat**    | 🐱💨 🐈💨 🐱💨💨 🐈💨💨                      |\n| **SpinnerRunningDog**    | 🐕💨 🐶💨 🐕‍🦺💨 🐕💨💨                        |\n| **SpinnerCycling**       | 🚴 🚴‍♂️ 🚴‍♀️ 🚵 🚵‍♂️ 🚵‍♀️                            |\n| **SpinnerCarLoading**    | 🚗💨 🚙💨 🚓💨 🚕💨 🚐💨 🚔💨                |\n| **SpinnerRocket**        | 🚀 🚀💨 🚀💨💨 🚀💨💨💨 🚀🌌 🚀🌠            |\n| **SpinnerOrbit**         | 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘                      |\n| **SpinnerTrain**         | 🚆 🚄 🚅 🚇 🚊 🚉                            |\n| **SpinnerAirplane**      | ✈️ 🛫 🛬 ✈️💨 ✈️💨💨                         |\n| **SpinnerFireworks**     | 🎆 🎇 🎆🎇 🎇🎆                              |\n| **SpinnerPizzaDelivery** | 🍕💨 🍔💨 🌭💨 🍟💨                          |\n| **SpinnerHeartbeat**     | 💓 💗 💖 💘 💞 💝 💖                         |\n\n## Available Progress Bar Styles\n\nThe ProgressBar can be styled using various predefined styles. Here’s a list of available styles:\n\n| Progress Bar Style          | Description                                                  |\n| --------------------------- | ------------------------------------------------------------ |\n| **PbStyleBasic**            | ===========================------------- 69%                 |\n| **PbStyleClassic**          | [############################..] 95%                         |\n| **PbStyleMinimal**          | **\\*\\***\\*\\*\\***\\*\\*** 79%                                   |\n| **PbStyleBold**             | ❮■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ❯ 93%        |\n| **PbStyleDashed**           | [▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▯▯▯▯▯▯▯▯▯▯▯▯▯▯▯▯▯▯] 61%          |\n| **PbStyleElegant**          | ❬▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▱▱▱▱▱▱▱▱❭ 79                     |\n| **PbStyleEmoji**            | 🚩🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀✨✨✨✨✨✨✨✨🎯 71%   |\n| **PbStyleFuturistic**       | ⟦◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉○○○○○○○○○○○○○○○○○⟧ 59%               |\n| **PbStyleGreenDevelopment** | 🌱🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿🌿\\_\\_\\_\\_🌳 91% |\n\n## Example\n\nHere’s a complete example that demonstrates both the spinner and the progress bar together:\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\t\"github.com/Kei-K23/spinix\"\n)\n\nfunc main() {\n\tspinner := spinix.NewSpinner()\n\tprogressBar := spinix.NewProgressBar()\n\n\tspinner.SetMessage(\"Loading Data...\")\n\tspinner.Start()\n\tprogressBar.SetWidth(50)\n\tprogressBar.SetColor(\"\\033[36m\") // Cyan\n\tprogressBar.Start()\n\n\tfor i := 0; i \u003c= 100; i++ {\n\t\tprogressBar.Update(i)\n\t\ttime.Sleep(50 * time.Millisecond) // Simulate work\n\t}\n\n\tprogressBar.Stop()\n\tspinner.Stop()\n}\n```\n\n## Demo\n\nThe demo run for the progress bar with style as `green`.\n\n![green-progress-bar](./images/green.gif)\n\n## Contributing\n\nContributions are welcome! Please feel free to open issues, submit pull requests, or provide feedback.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Contributors\n\nThanks to all the amazing contributors for making **spinix** better!\n\n\u003ca href=\"https://github.com/Kei-K23/spinix/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=Kei-K23/spinix\" /\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkei-k23%2Fspinix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkei-k23%2Fspinix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkei-k23%2Fspinix/lists"}