Convert Figma logo to code with AI

ConnorAtherton logoloaders.css

Delightful, performance-focused pure css loading animations.

10,213
1,217
10,213
15

Top Related Projects

3,516

This could take a while

19,349

A collection of loading indicators animated with CSS

A collection of loading spinners animated with CSS

🔮 CSS loading animations made with single element.

An awesome collection of — Pure CSS — Loaders and Spinners

Quick Overview

Loaders.css is a collection of loading animations created purely with CSS. It provides a variety of visually appealing and lightweight loading indicators that can be easily integrated into web projects without the need for JavaScript or images.

Pros

  • Pure CSS implementation, resulting in lightweight and fast-loading animations
  • Wide variety of loader styles to choose from
  • Easy to customize and integrate into existing projects
  • Cross-browser compatible

Cons

  • Limited functionality compared to more complex JavaScript-based loaders
  • Some animations may not be suitable for all design aesthetics
  • Customization options are somewhat limited without modifying the CSS directly
  • Lack of built-in responsiveness for different screen sizes

Code Examples

  1. Basic loader implementation:
<div class="loader-inner ball-pulse">
  <div></div>
  <div></div>
  <div></div>
</div>
  1. Customizing loader color:
.loader-inner > div {
  background-color: #3498db;
}
  1. Changing loader size:
.loader-inner {
  transform: scale(0.5);
}

Getting Started

  1. Include the CSS file in your HTML:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/loaders.css/0.1.2/loaders.min.css">
  1. Add the loader HTML to your page:
<div class="loader-inner ball-pulse">
  <div></div>
  <div></div>
  <div></div>
</div>
  1. Optionally, include the JavaScript file for dynamic loader creation:
<script src="https://cdnjs.cloudflare.com/ajax/libs/loaders.css/0.1.2/loaders.css.js"></script>
<script>
  loaders.init();
</script>

Competitor Comparisons

3,516

This could take a while

Pros of loading

  • Minimalistic and lightweight, focusing on simple SVG-based loaders
  • Easy to customize and integrate into React projects
  • Provides a more modern, vector-based approach to loading animations

Cons of loading

  • Limited variety of loader styles compared to loaders.css
  • Less cross-browser compatibility due to reliance on SVG
  • Requires React, limiting its use in non-React projects

Code Comparison

loaders.css:

.loader-inner.ball-pulse > div {
  background-color: #fff;
  width: 15px;
  height: 15px;
  border-radius: 100%;
  margin: 2px;
  animation-fill-mode: both;
}

loading:

const Loading = ({ size = 64 }) => (
  <svg
    viewBox="0 0 32 32"
    width={size}
    height={size}
    fill="currentcolor"
    style={style}
  >
    <circle cx={16} cy={16} r={14} opacity={.25} />
    <circle cx={16} cy={16} r={14} strokeWidth={4} strokeDasharray={80} strokeDashoffset={60} />
  </svg>
)

Summary

loaders.css offers a wide variety of CSS-based loaders with broad browser support, while loading provides a more focused set of SVG-based loaders optimized for React applications. The choice between the two depends on project requirements, with loaders.css being more versatile and loading being more modern and React-friendly.

19,349

A collection of loading indicators animated with CSS

Pros of SpinKit

  • More diverse and visually appealing animations
  • Better browser compatibility, including support for older versions
  • Easier to customize and modify individual spinners

Cons of SpinKit

  • Larger file size due to more complex animations
  • Less modular structure, making it harder to use only specific loaders
  • Fewer options for pure CSS implementations without JavaScript

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;
  animation-fill-mode: both;
  display: inline-block;
  animation: scale 0.75s 0.24s infinite cubic-bezier(.2,.68,.18,1.08);
}

Both libraries offer a variety of loading animations, but SpinKit tends to have more complex and visually striking options. loaders.css, on the other hand, provides a more modular approach with simpler, pure CSS implementations. The choice between the two depends on specific project requirements, desired visual effects, and performance considerations.

A collection of loading spinners animated with CSS

Pros of css-loaders

  • Simpler and more lightweight, with fewer dependencies
  • Easier to customize and modify individual loaders
  • Better browser compatibility, especially for older versions

Cons of css-loaders

  • Fewer loader options compared to loaders.css
  • Less consistent styling across different loader types
  • Limited documentation and usage examples

Code Comparison

css-loaders:

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

loaders.css:

@keyframes line-scale {
  0% {
    transform: scaley(1.0);
  }
  50% {
    transform: scaley(0.4);
  }
  100% {
    transform: scaley(1.0);
  }
}

.line-scale > div:nth-child(1) {
  animation: line-scale 1s -0.4s infinite cubic-bezier(.2, .68, .18, 1.08);
}

css-loaders offers a more straightforward approach to creating loading animations, making it easier for developers to understand and modify the code. However, loaders.css provides more complex and diverse animations, utilizing advanced CSS techniques and keyframes.

Both libraries serve their purpose well, with css-loaders being more suitable for simple projects or those requiring high compatibility, while loaders.css is better for projects needing a wider variety of sophisticated loading animations.

🔮 CSS loading animations made with single element.

Pros of three-dots

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

Cons of three-dots

  • Limited variety of animations compared to loaders.css
  • Less customization options for individual loaders
  • Fewer browser compatibility features

Code Comparison

three-dots:

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

loaders.css:

@keyframes scale {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  45% {
    transform: scale(0.1);
    opacity: 0.7;
  }
  80% {
    transform: scale(1);
    opacity: 1;
  }
}

three-dots provides a more straightforward approach to creating dot-based loading animations, with simpler CSS code and fewer keyframes. loaders.css offers more complex animations with additional keyframes and transformations, allowing for a wider range of effects.

While three-dots excels in simplicity and focused functionality, loaders.css provides a broader set of loading animations and more customization options. The choice between the two depends on the specific needs of the project, with three-dots being ideal for lightweight, dot-centric animations, and loaders.css offering a more comprehensive solution for various loading effects.

An awesome collection of — Pure CSS — Loaders and Spinners

Pros of Load Awesome

  • Offers a larger variety of loading animations (42 compared to 28 in Loaders.css)
  • Provides more customization options, including color and size adjustments
  • Includes both CSS and SCSS versions for greater flexibility

Cons of Load Awesome

  • Larger file size due to the increased number of animations
  • May require more setup time to implement and customize
  • Less frequently updated compared to Loaders.css

Code Comparison

Load Awesome:

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

Loaders.css:

<div class="loader-inner ball-spin-fade-loader">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</div>

Both repositories provide CSS-based loading animations, but Load Awesome offers more variety and customization options at the cost of a larger file size. Loaders.css is more lightweight and frequently updated, making it suitable for simpler projects. The code structure is similar, with Load Awesome using a slightly different class naming convention. Developers should consider their specific needs, such as the number of animations required and the importance of file size, when choosing between these two libraries.

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

Loaders.css

Delightful and performance-focused pure css loading animations.

What is this?

See the demo

A collection of loading animations written entirely in css. Each animation is limited to a small subset of css properties in order to avoid expensive painting and layout calculations.

I've posted links below to some fantastic articles that go into this in a lot more detail.

Install

bower install loaders.css
npm i --save loaders.css

Usage

Standard
  • Include loaders.min.css
  • Create an element and add the animation class (e.g. <div class="loader-inner ball-pulse"></div>)
  • Insert the appropriate number of <div>s into that element
jQuery (optional)
  • Include loaders.min.css, jQuery, and loaders.css.js
  • Create an element and add the animation class (e.g. <div class="loader-inner ball-pulse"></div>)
  • loaders.js is a simple helper to inject the correct number of div elements for each animation
  • To initialise loaders that are added after page load select the div and call loaders on them (e.g. $('.loader-inner').loaders())
  • Enjoy

Customising

Changing the background color

Add styles to the correct child div elements

.ball-grid-pulse > div {
  background-color: orange;
}
Changing the loader size

Use a 2D Scale transform

.loader-small .loader-inner {
  transform: scale(0.5, 0.5);
}

Browser support

Check the can I use tables. All recent versions of the major browsers are supported and it has support back to IE9.

Note: The loaders aren't run through autoprefixer, see this issue.

IE 11Firefox 36Chrome 41Safari 8
✔✔✔✔

Contributing

Pull requests are welcome! Create another file in src/animations and load it in src/loader.scss.

In a separate tab run gulp --require coffee-script/register. Open demo/demo.html in a browser to see your animation running.

Further research

Inspired by loaders.css

A few other folks have taken loaders and ported them elsewhere.

Licence

The MIT License (MIT)

Copyright (c) 2016 Connor Atherton

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

NPM DownloadsLast 30 Days