README.md

January 14, 2026 ยท View on GitHub

React Loader Spinner

React Loader Spinner

npm version downloads stars release last publish issues license

Simple, lightweight React SVG spinner components
Perfect for async operations and loading states

๐Ÿ“š Documentation โ€ข ๐ŸŽจ Live Demo โ€ข ๐Ÿ’ป CodeSandbox


โœจ Features

  • ๐ŸŽฏ 35+ Beautiful Spinners - Wide variety of loading animations
  • ๐ŸŽจ Fully Customizable - Colors, sizes, and styles
  • ๐Ÿ“ฆ Lightweight - Zero dependencies (except React)
  • ๐ŸŒฒ Tree-shakeable - Import only what you need
  • ๐Ÿ’ช TypeScript - Full type definitions included
  • โšก React 17, 18 & 19 - Compatible with all modern React versions
  • ๐ŸŽญ No CSS Required - Pure SVG animations
  • โ™ฟ Accessible - ARIA labels and semantic HTML

๐Ÿ“ฆ Installation

npm install react-loader-spinner

Or using yarn:

yarn add react-loader-spinner

๐Ÿš€ Quick Start

import { Audio } from 'react-loader-spinner'

function App() {
  return (
    <Audio
      height="80"
      width="80"
      color="#4fa94d"
      ariaLabel="audio-loading"
      wrapperStyle={{}}
      wrapperClass="wrapper-class"
      visible={true}
    />
  )
}

๐Ÿ“– Documentation

Visit our complete documentation for:

๐ŸŽจ Available Spinners

View all 35+ spinners
  • Audio
  • Ball Triangle
  • Bars
  • Blocks
  • Circles
  • Circles With Bar
  • Circular Progress
  • Color Ring
  • Comment
  • Discuss
  • DNA
  • Falling Lines
  • Fidget Spinner
  • Grid
  • Hearts
  • Hourglass
  • Infinity Spin
  • Line Wave
  • Magnifying Glass
  • Mutating Dots
  • Oval
  • Progress Bar
  • Puff
  • Radio
  • Revolving Dot
  • Rings
  • Rotating Lines
  • Rotating Square
  • Rotating Triangles
  • Tail Spin
  • Three Circles
  • Three Dots
  • Triangle
  • Vortex
  • Watch

๐Ÿ’ก Usage Examples

Basic Usage

import { Oval } from 'react-loader-spinner'
;<Oval
  height={80}
  width={80}
  color="#4fa94d"
  visible={true}
  ariaLabel="oval-loading"
  secondaryColor="#4fa94d"
  strokeWidth={2}
  strokeWidthSecondary={2}
/>

With Custom Styling

import { ThreeDots } from 'react-loader-spinner'
;<ThreeDots
  height="80"
  width="80"
  radius="9"
  color="#4fa94d"
  ariaLabel="three-dots-loading"
  wrapperStyle={{ margin: '20px' }}
  wrapperClass="custom-loader"
  visible={true}
/>

Conditional Rendering

import { TailSpin } from 'react-loader-spinner'

function MyComponent() {
  const [loading, setLoading] = useState(true)

  return (
    <div>
      <TailSpin
        height="80"
        width="80"
        color="#4fa94d"
        ariaLabel="tail-spin-loading"
        visible={loading}
      />
    </div>
  )
}

Tree-shaking with Direct Imports

For optimal bundle size, import components directly:

// Direct import (better for tree-shaking)
import { Audio } from 'react-loader-spinner/dist/esm/loader/audio'

// Or use named imports (also tree-shakeable)
import { Audio, Oval, ThreeDots } from 'react-loader-spinner'

๐ŸŽฏ Common Props

All spinner components accept these common props:

PropTypeDefaultDescription
heightstring | number"100"Height of the spinner
widthstring | number"100"Width of the spinner
colorstring"#4fa94d"Primary color
visiblebooleantrueShow/hide the spinner
ariaLabelstringComponent-specificAccessibility label
wrapperStyleCSSProperties{}Inline styles for wrapper
wrapperClassstring""CSS class for wrapper

Note: Individual components may have additional specific props. Check the documentation for each component.

๐Ÿ”ง TypeScript Support

This package includes TypeScript definitions out of the box:

import { Audio } from 'react-loader-spinner'
import type { CSSProperties } from 'react'

const wrapperStyle: CSSProperties = {
  display: 'flex',
  justifyContent: 'center',
}

;<Audio height="80" width="80" color="blue" wrapperStyle={wrapperStyle} />

๐ŸŒ Browser Support

  • โœ… Chrome (latest)
  • โœ… Firefox (latest)
  • โœ… Safari (latest)
  • โœ… Edge (latest)
  • โœ… Modern mobile browsers

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

MIT ยฉ Mohan Upadhyay

๐Ÿ™ Contributors

Thanks goes to these wonderful people:


Made with โค๏ธ by Mohan Upadhyay

โญ Star us on GitHub โ€” it helps!