Spinners is a header-only C++ library providing elegant terminal spinners for C++11 onwards.
Add spinners.hpp
to the project and use provided spinners from the spinners
namespace.
#include "spinners.hpp"
using namespace spinners;
int main()
{
Spinner *spinner = new Spinner();
spinner->setText("Loading ...");
spinner->setInterval(100);
spinner->setSymbols("dots4");
spinner->start();
std::this_thread::sleep_for(std::chrono::seconds(5));
spinner->stop();
return 0;
}
Also check source from the examples/
folder.
For available spinners please check the source in include/spinners.hpp
folder or run the example demo provided.
Thanks to Sindre Sorhus for providing the awesome ora library for Node.JS where I extracted spinner chars from.
MIT