A collection of cli loaders for your command-line applications.
Visit the website to see all loaders, copy keyframes, and more!
⚠️ VARIANT LOADER NAMES CHANGED IN v2.1.5+: Any loader name withvariant
in it has been deleted in favor of a cleaner, simplistic loader name convention.
Example: If you were using arrows_variant_1
prior to v2.1.5, the loader name will now simply be arrows_1
. This change only applies to variants. View the website for the latest updates or to view the changelog.
To install the package, use npm or yarn:
npm install cli-loaders
# or
yarn add cli-loaders
# or
bun install cli-loaders
Import the loader initializer
import { initLoader } from 'cli-loaders';
You can initialize any loader by its name using initLoader
import { initLoader } from 'cli-loaders';
// Initialize by name
initLoader('dots_variant_1');
You can also customize the speed of the loader:
import { initLoader } from 'cli-loaders';
// Initialize with custom speed
initLoader('dots_variant_1', 100);
New to v2.0+, you can import a custom loader initializer, initCustomLoader
import { initCustomLoader } from 'cli-loaders';
Then use it with your own speed and keyframe arguments:
initCustomLoader(100, ["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]);
Upgrading versions can be breaking. Double check the website first, to see if a loader has moved or is following a new naming convention. The website will always be updated with the most current version of cli-loaders.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.
Special thanks to cli-spinners and sindresorhus for the json file for some of the loaders in this project.