Convert Figma logo to code with AI

tobiasahlin logoSpinKit

A collection of loading indicators animated with CSS

19,350
1,811
19,350
10

Top Related Projects

3,516

This could take a while

Delightful, performance-focused pure css loading animations.

A collection of loading spinners animated with CSS

🔮 CSS loading animations made with single element.

A set of SCSS mixins for single element loaders and spinners

Quick Overview

SpinKit is a collection of simple CSS spinners and loading indicators. It provides a set of animated loading icons that can be easily integrated into web projects to enhance user experience during content loading or processing times.

Pros

  • Easy to implement with minimal CSS and HTML
  • Customizable colors and sizes to match project designs
  • Lightweight and performant, with no JavaScript dependencies
  • Wide variety of spinner styles to choose from

Cons

  • Limited to CSS-based animations, which may not be as complex as SVG or JavaScript-based alternatives
  • Some spinners may not be suitable for older browsers with limited CSS support
  • Lack of built-in responsiveness for different screen sizes

Code Examples

  1. Basic spinner implementation:
<div class="spinner">
  <div class="dot1"></div>
  <div class="dot2"></div>
</div>
  1. Customizing spinner color:
.spinner {
  --sk-color: #333;
}
  1. Adjusting spinner size:
.spinner {
  width: 60px;
  height: 60px;
}

Getting Started

  1. Include the SpinKit CSS in your HTML:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/SpinKit/2.0.1/spinkit.min.css" />
  1. Add the HTML for your chosen spinner (e.g., the "rotating plane"):
<div class="sk-rotating-plane"></div>
  1. Customize the spinner as needed using CSS variables or additional styles:
.sk-rotating-plane {
  --sk-color: #3498db;
  width: 40px;
  height: 40px;
}

Competitor Comparisons

3,516

This could take a while

Pros of loading

  • Lightweight and minimalistic approach
  • Customizable through JavaScript API
  • Supports SVG-based animations

Cons of loading

  • Limited variety of pre-built loading animations
  • Less visually appealing out-of-the-box designs
  • Requires more manual configuration for complex animations

Code Comparison

SpinKit (CSS):

.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;
}

loading (JavaScript):

var loading = require('loading')
var spinner = loading({
  dots: 4,
  size: 32,
  color: '#07c'
}).appendTo(document.body)
spinner.start()

SpinKit offers a wider range of pre-built, CSS-based loading animations that are easy to implement and visually appealing. It provides more out-of-the-box options and requires less configuration for complex animations.

loading, on the other hand, focuses on a lightweight approach with customizable SVG-based animations. It offers more flexibility through its JavaScript API but requires more manual configuration for advanced designs.

SpinKit is better suited for quick implementation of visually appealing loaders, while loading is ideal for developers who prefer a programmatic approach and want to create custom SVG animations.

Delightful, performance-focused pure css loading animations.

Pros of loaders.css

  • Offers a wider variety of loader animations (42 compared to SpinKit's 12)
  • Includes both CSS and Sass versions for greater flexibility
  • Provides a demo page with easy-to-copy HTML snippets for each loader

Cons of loaders.css

  • Larger file size due to the greater number of animations
  • Some animations may be more complex, potentially impacting performance on older devices
  • Less frequently updated compared to SpinKit

Code Comparison

SpinKit (CSS for a simple spinner):

.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;
}

loaders.css (CSS for a similar spinner):

.loader-inner.ball-pulse > div {
  width: 15px;
  height: 15px;
  border-radius: 100%;
  margin: 2px;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
  display: inline-block;
}

Both libraries offer easy-to-use CSS-based loading animations, with SpinKit focusing on simplicity and performance, while loaders.css provides a wider range of options at the cost of a larger file size.

A collection of loading spinners animated with CSS

Pros of css-loaders

  • More variety of loader styles (11 different loaders)
  • Simpler CSS implementation, easier to customize
  • Smaller file size, potentially faster load times

Cons of css-loaders

  • Less browser compatibility, especially for older versions
  • Fewer animation options within each loader style
  • Less documentation and examples provided

Code Comparison

SpinKit example:

.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;
}

css-loaders example:

.loader {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #3498db;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
}

Both repositories offer CSS-based loading animations, but they differ in their approach and features. SpinKit provides a more comprehensive set of animations with better browser compatibility, while css-loaders offers a wider variety of loader styles with simpler implementation. The choice between the two depends on specific project requirements, such as browser support needs and desired animation complexity.

🔮 CSS loading animations made with single element.

Pros of Three-dots

  • Smaller file size and lighter weight
  • Focuses specifically on dot-based loading animations
  • Simpler implementation with fewer dependencies

Cons of Three-dots

  • Limited variety of animation styles compared to SpinKit
  • Less customization options for colors and sizes
  • Not as widely adopted or recognized in the developer community

Code Comparison

SpinKit:

.sk-chase {
  width: 40px;
  height: 40px;
  position: relative;
  animation: sk-chase 2.5s infinite linear both;
}

Three-dots:

.dot-elastic {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #9880ff;
  animation: dotElastic 1s infinite linear;
}

Both libraries provide CSS-based loading animations, but SpinKit offers a wider range of styles and more complex animations. Three-dots focuses on simpler, dot-based animations with a more streamlined approach.

SpinKit is more versatile and widely used, making it suitable for various projects. Three-dots is a good choice for developers who specifically need dot-based loading animations and prefer a lighter-weight solution.

Consider your project requirements, desired animation styles, and performance needs when choosing between these two libraries.

A set of SCSS mixins for single element loaders and spinners

Pros of SpinThatShit

  • Offers a wider variety of spinner styles and animations
  • Provides SCSS mixins for easy customization and integration
  • Includes more complex and visually appealing spinner designs

Cons of SpinThatShit

  • Less browser compatibility compared to SpinKit
  • Requires SCSS preprocessing, which may not be suitable for all projects
  • Slightly larger file size due to more complex animations

Code Comparison

SpinKit (CSS):

.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;
}

SpinThatShit (SCSS):

@import 'spinners/spinner-1';

.spinner {
  @include spinner-1(
    $size: 40px,
    $color: #333,
    $duration: 1.2s,
    $gap: 4px
  );
}

Both libraries provide easy-to-use loading spinners, but SpinThatShit offers more customization options through SCSS mixins. SpinKit focuses on simplicity and broad browser support, while SpinThatShit provides more complex and visually appealing designs at the cost of requiring SCSS preprocessing.

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

SpinKit

Simple loading spinners animated with CSS. See demo. SpinKit only uses (transform and opacity) CSS animations to create smooth and easily customizable animations.

Usage

  • Add spinkit.css or spinkit.min.css to your project (or copy-paste the CSS that you need for your spinner—there are no dependencies between spinners, no shared classes, and no shared animations, etc, so it should be fairly straight-forward to extract only the code that you need)
  • Add a spinner to your project by copy-pasting HTML from spinkit.css or examples.html
  • Add the sk-center utility class to the spinner to center it (it sets margin to auto)
  • By default, the width and height of all spinners are set to 40px. background-color is set to #333.
  • Configure the spinner by overwriting the CSS variables, primarily --sk-size (spinner width & height) and --sk-color (spinner color). If you need broader browser support, remove the CSS variables.

You can include SpinKit to your project with bower:

$ bower install spinkit

or npm:

$ npm install spinkit

Spinners

Given that you have included spinkit.min.css in your project, these snippets will produce the different spinners:

Plane

<div class="sk-plane"></div>

Chase

<div class="sk-chase">
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
</div>

Bounce

<div class="sk-bounce">
  <div class="sk-bounce-dot"></div>
  <div class="sk-bounce-dot"></div>
</div>

Wave

<div class="sk-wave">
  <div class="sk-wave-rect"></div>
  <div class="sk-wave-rect"></div>
  <div class="sk-wave-rect"></div>
  <div class="sk-wave-rect"></div>
  <div class="sk-wave-rect"></div>
</div>

Pulse

<div class="sk-pulse"></div>

Flow

<div class="sk-flow">
  <div class="sk-flow-dot"></div>
  <div class="sk-flow-dot"></div>
  <div class="sk-flow-dot"></div>
</div>

Swing

<div class="sk-swing">
  <div class="sk-swing-dot"></div>
  <div class="sk-swing-dot"></div>
</div>

Circle

<div class="sk-circle">
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
  <div class="sk-circle-dot"></div>
</div>

Circle Fade

<div class="sk-circle-fade">
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
  <div class="sk-circle-fade-dot"></div>
</div>

Grid

<div class="sk-grid">
  <div class="sk-grid-cube"></div>
  <div class="sk-grid-cube"></div>
  <div class="sk-grid-cube"></div>
  <div class="sk-grid-cube"></div>
  <div class="sk-grid-cube"></div>
  <div class="sk-grid-cube"></div>
  <div class="sk-grid-cube"></div>
  <div class="sk-grid-cube"></div>
  <div class="sk-grid-cube"></div>
</div>

Fold

<div class="sk-fold">
  <div class="sk-fold-cube"></div>
  <div class="sk-fold-cube"></div>
  <div class="sk-fold-cube"></div>
  <div class="sk-fold-cube"></div>
</div>

Wander

<div class="sk-wander">
  <div class="sk-wander-cube"></div>
  <div class="sk-wander-cube"></div>
  <div class="sk-wander-cube"></div>
</div>

Web browser compatibility

SpinKit uses CSS animations and variables:

Implementing a fallback spinner

How do you know if you need to provide a fallback? You can check for animation support with Modernizr, or manually check for the animation property, and replace the spinner with a GIF if it's not supported:

function browserSupportsCSSProperty(propertyName) {
  var elm = document.createElement('div');
  propertyName = propertyName.toLowerCase();

  if (elm.style[propertyName] != undefined)
    return true;

  var propertyNameCapital = propertyName.charAt(0).toUpperCase() + propertyName.substr(1),
    domPrefixes = 'Webkit Moz ms O'.split(' ');

  for (var i = 0; i < domPrefixes.length; i++) {
    if (elm.style[domPrefixes[i] + propertyNameCapital] != undefined)
      return true;
  }

  return false;
}

Use it to check for animation support:

if (!browserSupportsCSSProperty('animation')) {
  // fallback…
}

NPM DownloadsLast 30 Days