Convert Figma logo to code with AI

jxnblk logoloading

This could take a while

3,516
267
3,516
10

Top Related Projects

🔮 CSS loading animations made with single element.

19,349

A collection of loading indicators animated with CSS

Delightful, performance-focused pure css loading animations.

A collection of loading spinners animated with CSS

1,040

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

Quick Overview

Loading is a collection of loading indicator animations for React. It provides simple, customizable, and reusable loading components that can be easily integrated into React applications to enhance user experience during asynchronous operations.

Pros

  • Easy to use and integrate into existing React projects
  • Offers a variety of loading animation styles
  • Customizable in terms of size, color, and speed
  • Lightweight and performant

Cons

  • Limited to React applications only
  • May require additional styling for complex UI designs
  • Documentation could be more comprehensive
  • Not actively maintained (last update was several years ago)

Code Examples

Basic usage of the Dots loading indicator:

import React from 'react'
import { Dots } from 'react-loading'

const LoadingComponent = () => (
  <Dots color="#007bff" size={32} />
)

Customizing the Loading component:

import React from 'react'
import { Bars } from 'react-loading'

const CustomLoading = () => (
  <Bars
    color="#00BFFF"
    height={100}
    width={100}
    ariaLabel="loading-indicator"
  />
)

Using the Loading component with a condition:

import React from 'react'
import { Oval } from 'react-loading'

const ConditionalLoading = ({ isLoading }) => (
  <div>
    {isLoading ? (
      <Oval color="#32CD32" secondaryColor="#228B22" />
    ) : (
      <p>Content loaded!</p>
    )}
  </div>
)

Getting Started

To use the Loading components in your React project, follow these steps:

  1. Install the package:

    npm install react-loading
    
  2. Import and use the desired loading component in your React code:

    import React from 'react'
    import { Circles } from 'react-loading'
    
    const App = () => (
      <div>
        <h1>Loading Example</h1>
        <Circles color="#123abc" height={80} width={80} />
      </div>
    )
    
    export default App
    
  3. Customize the component props as needed (color, size, etc.) to fit your application's design.

Competitor Comparisons

🔮 CSS loading animations made with single element.

Pros of three-dots

  • Offers a wider variety of loading animations (12 types)
  • Provides customization options for color, size, and speed
  • Includes both CSS and SCSS versions for flexibility

Cons of three-dots

  • Larger file size due to more animation options
  • May require more setup and configuration for specific use cases
  • Less minimalistic approach compared to loading

Code Comparison

loading:

.loading {
  animation: loading 1s infinite alternate;
}

@keyframes loading {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

three-dots:

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

Both repositories provide CSS-based loading animations, but three-dots offers more complex and diverse options. loading focuses on a simple, minimalistic approach with a single animation, while three-dots provides multiple animation types with customization possibilities. The code examples showcase the difference in complexity between the two projects.

19,349

A collection of loading indicators animated with CSS

Pros of SpinKit

  • Offers a wider variety of loading animations (11 different styles)
  • Includes both CSS and SCSS versions for flexibility
  • Provides detailed documentation and examples for each animation

Cons of SpinKit

  • Larger file size due to more complex animations
  • May require more customization to fit specific design needs
  • Some animations might be too elaborate for minimalist designs

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 el = loading()
document.body.appendChild(el)

SpinKit offers more complex CSS-based animations with various styles, while loading provides a simpler JavaScript-based approach for creating loading indicators. SpinKit is better suited for projects requiring diverse, visually appealing loading animations, whereas loading is ideal for quick implementation and minimal customization needs. The choice between the two depends on the specific requirements of the project, such as design complexity, file size constraints, and preferred implementation method.

Delightful, performance-focused pure css loading animations.

Pros of loaders.css

  • Offers a wider variety of loader animations (30+)
  • Provides both CSS and Sass versions for flexibility
  • Includes a demo page for easy visualization of all loaders

Cons of loaders.css

  • Larger file size due to more animations and options
  • May require more customization to fit specific design needs
  • Less focused on minimalism compared to loading

Code Comparison

loading:

.loading {
  animation: loading 1s infinite linear;
}

@keyframes loading {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

loaders.css:

.ball-pulse > div {
  animation: scale 0.75s -0.24s infinite cubic-bezier(.2, .68, .18, 1.08);
}

@keyframes scale {
  0%, 80%, 100% { transform: scale(1); opacity: 1; }
  40% { transform: scale(0.3); opacity: 0.3; }
}

Both repositories provide CSS-based loading animations, but they differ in approach and complexity. loading focuses on simplicity with a single, customizable spinner animation. loaders.css offers a broader range of pre-built animations, catering to various design preferences. The code comparison shows that loading uses a straightforward rotation animation, while loaders.css employs more complex keyframes for diverse effects. Choose loading for minimalism and easy customization, or loaders.css for a ready-to-use variety of loader styles.

A collection of loading spinners animated with CSS

Pros of css-loaders

  • Offers a wider variety of loader styles (8 different options)
  • Pure CSS implementation, no JavaScript required
  • Easily customizable through CSS variables

Cons of css-loaders

  • Less lightweight, with more complex CSS
  • Not as easily integrated into JavaScript frameworks
  • Lacks the simplicity and minimalism of loading

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

loading:

import React from 'react'
import { Loading } from 'loading'

export default () => (
  <Loading />
)

css-loaders provides more complex CSS animations for various loader styles, while loading offers a simpler, React-based approach with minimal code required for implementation.

css-loaders is better suited for projects where pure CSS solutions are preferred and a variety of loader styles is desired. loading is more appropriate for React-based projects that prioritize simplicity and minimal code overhead.

Both libraries serve their purposes well, with css-loaders offering more visual variety and loading providing a more streamlined, framework-friendly solution.

1,040

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

Pros of csspin

  • Offers a wider variety of loading animations (25+) compared to loading's single animation
  • Provides pure CSS solutions without JavaScript dependencies
  • Includes more customization options for colors, sizes, and styles

Cons of csspin

  • Larger file size due to multiple animation styles
  • May require more effort to implement and customize compared to loading's simpler approach
  • Less frequently updated and maintained than loading

Code Comparison

loading:

<div class="loading"></div>
.loading {
  animation: loading 1s infinite linear;
}

csspin:

<div class="cp-spinner cp-round"></div>
.cp-spinner {
  width: 48px;
  height: 48px;
  display: inline-block;
  box-sizing: border-box;
  position: relative;
}

Summary

csspin offers more variety and customization options for loading animations using pure CSS, while loading provides a simpler, more lightweight solution with a single animation style. csspin may be better suited for projects requiring diverse loading indicators, whereas loading is ideal for minimalist designs or performance-critical applications. The choice between the two depends on the specific needs of the project and the desired balance between variety and simplicity.

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

Loading...

This could take a while

http://jxnblk.com/loading

Getting Started

npm install loading-svg

Or

bower install loading

Usage

<img src="loading-balls.svg" alt="Loading icon" />

Custom colors

Just change the fill attribute in the svg file to whatever.

<svg class="icon-loading" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="blue">

About

This was mostly meant as a joke and an opportunity to learn about animated SVG. Feel free to use the source code as an example or in any project of your own.

If you do intend to use these in production, be aware of limited browser support and be prepared to create fallbacks.

http://caniuse.com/svg-smil

Also be aware of user experience issues with perceptual loading time. Subtler is usually better.


The MIT License (MIT)

Copyright (c) 2014 Brent Jackson

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