Convert Figma logo to code with AI

webkul logocsspin

CSS Spinners and Loaders - Modular, Customizable and Single HTML Element Code for Pure CSS Loader and Spinner

1,040
116
1,040
3

Top Related Projects

An awesome collection of — Pure CSS — Loaders and Spinners

19,349

A collection of loading indicators animated with CSS

A collection of loading spinners animated with CSS

1,738

CSS loading animations with minimal effort!

Delightful, performance-focused pure css loading animations.

A set of SCSS mixins for single element loaders and spinners

Quick Overview

The webkul/csspin project is a collection of pure CSS loading spinners and loaders that can be easily integrated into web applications. It provides a variety of customizable and lightweight spinner designs without the need for any JavaScript.

Pros

  • Variety of Spinner Designs: The project offers a wide range of spinner designs, including classic loaders, rotating circles, and more, allowing developers to choose the one that best fits their project's aesthetic.
  • Pure CSS Implementation: The spinners are implemented using only CSS, which means they are lightweight and do not require any JavaScript, making them easy to integrate and maintain.
  • Customizable: The spinners can be easily customized by adjusting the CSS properties, such as color, size, and animation speed, to match the branding and design of the project.
  • Responsive: The spinners are designed to be responsive and work well across different screen sizes and devices.

Cons

  • Limited Functionality: The project is focused solely on providing CSS-based spinners and does not offer any additional functionality or features beyond that.
  • Dependency on CSS: Since the spinners are implemented using CSS, they may not be as flexible or dynamic as JavaScript-based solutions, which can offer more advanced features and interactions.
  • Potential Performance Impact: Depending on the complexity of the spinner and the number of elements on the page, the CSS-based spinners may have a slight performance impact, especially on older or less powerful devices.
  • Lack of Accessibility Features: The project does not currently provide any built-in accessibility features, such as alternative text or ARIA attributes, which may be important for certain use cases.

Code Examples

Here are a few examples of how to use the webkul/csspin project:

  1. Classic Spinner:
<div class="spinner">
  <div class="double-bounce1"></div>
  <div class="double-bounce2"></div>
</div>
.spinner {
  width: 40px;
  height: 40px;
  position: relative;
  margin: 100px auto;
}

.double-bounce1, .double-bounce2 {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #333;
  opacity: 0.6;
  position: absolute;
  top: 0;
  left: 0;
  animation: sk-bounce 2.0s infinite ease-in-out;
}

.double-bounce2 {
  animation-delay: -1.0s;
}

@keyframes sk-bounce {
  0%, 100% { transform: scale(0.0); }
  50% { transform: scale(1.0); }
}
  1. Rotating Circle Spinner:
<div class="spinner">
  <div class="circle"></div>
</div>
.spinner {
  width: 40px;
  height: 40px;
  position: relative;
  margin: 100px auto;
}

.circle {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border: 3px solid #333;
  border-radius: 50%;
  animation: sk-rotate 2.0s infinite linear;
}

@keyframes sk-rotate {
  100% { transform: rotate(360deg); }
}
  1. Pulsing Spinner:
<div class="spinner">
  <div class="pulse"></div>
</div>
.spinner {
  width: 40px;
  height: 40px;
  position: relative;
  margin: 100px auto;
}

.pulse {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #333;
  opacity: 0.5;
  position: absolute;
  top: 0;
  left: 0;
  animation: sk-pulse 2.0s infinite ease-in-out;
}

@keyframes sk-pulse {
  0% {

Competitor Comparisons

An awesome collection of — Pure CSS — Loaders and Spinners

Pros of load-awesome

  • Offers a wider variety of loading animations (42 compared to csspin's 20)
  • Provides more customization options for each loader
  • Includes both CSS and SASS versions for flexibility

Cons of load-awesome

  • Larger file size due to more animations and options
  • May require more setup time to implement specific loaders
  • Less frequently updated (last update in 2016 vs csspin's 2022)

Code Comparison

load-awesome:

<div class="la-ball-spin la-dark la-2x">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</div>

csspin:

<div class="cp-spinner cp-round"></div>

Summary

load-awesome offers more variety and customization options for loading animations, making it suitable for projects requiring diverse loader styles. However, it comes with a larger file size and may require more setup time. csspin, while offering fewer options, provides a simpler implementation and has been more recently updated. The choice between the two depends on the specific needs of the project, balancing between variety and simplicity.

19,349

A collection of loading indicators animated with CSS

Pros of SpinKit

  • More diverse and visually appealing spinner designs
  • Better browser compatibility, including support for older versions
  • Larger community and more frequent updates

Cons of SpinKit

  • Larger file size due to more complex animations
  • Requires additional CSS classes for customization

Code Comparison

SpinKit:

.spinner {
  width: 40px;
  height: 40px;
  background-color: #333;
  margin: 100px auto;
  -webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;
  animation: sk-rotateplane 1.2s infinite ease-in-out;
}

csspin:

.cp-spinner {
  width: 48px;
  height: 48px;
  display: inline-block;
  box-sizing: border-box;
  position: relative;
}

Summary

SpinKit offers a wider variety of spinner designs and better browser compatibility, making it suitable for projects requiring diverse loading animations. However, it comes with a larger file size and may require additional customization.

csspin, on the other hand, provides a simpler approach with a smaller file size, but offers fewer spinner options and may have limited compatibility with older browsers.

The choice between the two depends on project requirements, desired visual variety, and performance considerations.

A collection of loading spinners animated with CSS

Pros of css-loaders

  • More variety of loader styles (12 different options)
  • Simpler implementation with single HTML element
  • Smaller file size for individual loaders

Cons of css-loaders

  • Less customization options for colors and sizes
  • No built-in animation delay feature
  • Lacks comprehensive documentation

Code Comparison

css-loaders:

<div class="loader">Loading...</div>
.loader {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #3498db;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
}

csspin:

<div class="cp-spinner cp-round"></div>
.cp-spinner {
  width: 48px;
  height: 48px;
  display: inline-block;
  box-sizing: border-box;
  position: relative;
}
.cp-round:before {
  border: 6px solid #bababa;
  border-top-color: #02aeef;
  border-radius: 50%;
  content: " ";
  width: 48px;
  height: 48px;
  display: inline-block;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  animation: cp-round-animate 1s ease-in-out infinite;
}

Both repositories offer CSS-based loading animations, but css-loaders provides more variety with simpler implementation, while csspin offers more customization options and better documentation.

1,738

CSS loading animations with minimal effort!

Pros of Whirl

  • More extensive collection of loading animations (over 100 vs. 30+ in CSSpin)
  • Includes both CSS and SCSS versions for flexibility
  • Offers a live demo site for easy preview and selection

Cons of Whirl

  • Larger file size due to the extensive collection
  • May require more time to find the desired animation among the many options
  • Some animations might be more complex, potentially impacting performance

Code Comparison

Whirl example:

.whirl:after {
  content: "\0020";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border-radius: 50%;
  border: 6px solid #fff;
  border-color: #fff transparent #fff transparent;
  animation: whirl 1.5s linear infinite;
}

CSSpin example:

.cp-spinner {
  width: 48px;
  height: 48px;
  display: inline-block;
  box-sizing: border-box;
  position: relative;
}
.cp-round:before {
  border: 6px solid #bababa;
  border-top-color: #0099e5;
  border-radius: 50%;
  content: " ";
  width: 48px;
  height: 48px;
  display: inline-block;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  animation: cp-round-animate 1s linear infinite;
}

Both libraries offer CSS-based loading animations, but Whirl provides a larger variety and more customization options, while CSSpin focuses on a smaller set of commonly used spinners.

Delightful, performance-focused pure css loading animations.

Pros of loaders.css

  • More diverse collection of loader animations (42 types)
  • Includes both CSS and Sass versions for flexibility
  • Offers single-element CSS animations for simpler implementation

Cons of loaders.css

  • Larger file size due to more animations
  • Less focused on pure CSS spinners compared to csspin
  • May require more customization for specific use cases

Code Comparison

csspin:

.cp-spinner {
  width: 48px;
  height: 48px;
  display: inline-block;
  box-sizing: border-box;
  position: relative;
}

loaders.css:

.loader {
  color: #ffffff;
  font-size: 90px;
  text-indent: -9999em;
  overflow: hidden;
  width: 1em;
  height: 1em;
}

Key Differences

  • csspin focuses specifically on CSS spinners, while loaders.css offers a broader range of loading animations
  • loaders.css provides both CSS and Sass versions, giving developers more options for integration
  • csspin's animations are generally simpler and more lightweight, while loaders.css offers more complex and diverse animations
  • loaders.css has a larger community and more frequent updates, potentially leading to better long-term support

Both libraries serve similar purposes but cater to different needs. csspin is ideal for projects requiring simple, lightweight spinners, while loaders.css is better suited for those seeking a wide variety of loading animations with more customization options.

A set of SCSS mixins for single element loaders and spinners

Pros of SpinThatShit

  • Offers more customization options through Sass mixins
  • Provides a wider variety of spinner styles and animations
  • Includes a build system for easier development and customization

Cons of SpinThatShit

  • Requires Sass compilation, which may add complexity to some projects
  • Has fewer pre-built CSS classes for quick implementation
  • Documentation is less comprehensive compared to csspin

Code Comparison

SpinThatShit (Sass mixin):

@include spinner(
  $size: 40px,
  $border-size: 4px,
  $border-color: #000,
  $spin-color: #fff
);

csspin (CSS class):

<div class="cp-spinner cp-round"></div>

Summary

SpinThatShit offers more flexibility and customization options through Sass mixins, making it ideal for projects that already use Sass. It provides a wider range of spinner styles and animations, allowing for more creative implementations.

csspin, on the other hand, offers a simpler approach with pre-built CSS classes, making it easier to implement quickly without the need for compilation. It has more comprehensive documentation, which can be beneficial for beginners or those looking for a quick solution.

The choice between the two depends on project requirements, existing tech stack, and the level of customization needed for the loading spinners.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CSSPIN

CSS Spinners and Loaders - Modular, Customizable and Single HTML Element Code.

CSSPIN Library has a different set of interactive Pure CSS Loaders and Spinners which are built on the top of LESS Preprocessor. Individual Pure CSS Loader or Spinner can be easily customized and can be embedded with Single HTML Element in your next Dev Project.

Demo

Check out Spinners in Motion

Project Using CSSPIN

Opencart Point of Sale

Installation

Install CSSPIN with npm or Bower Package Manager

npm install csspin
bower install csspin

CSSPIN Video

Less File Structure

./less/
  ... _globals.less   
  ... _round.less   
  ... csspin-xxxx.less   
  ... csspin.less   

How Less Stucture Works?

  • Less files with _ are partials and have actual magic
  • Less files without _ only imports partials
  • Less files named csspin-xxxx.less imports _globals.less and respective _partial.less
  • Less files named csspin-xxxx.less acts as an individual module and can be compiled to css/csspin-xxxx.css for individual use
  • Less file named csspin.less imports all the partials and is compiled to csspin.css

CSS File Structure

./css/    
  ... csspin-xxxx.css 
./csspin.css  

How CSS Structure Works?

  • CSS File named csspin.css consists CSS of all the spinners
  • CSS File named csspin-xxxx.css consists CSS of respective spinners

Credits

Crafted with :heart: at Webkul UXlab

NPM DownloadsLast 30 Days