- π― 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
npm install react-loader-spinnerOr using yarn:
yarn add react-loader-spinnerimport { Audio } from 'react-loader-spinner'
function App() {
return (
<Audio
height="80"
width="80"
color="#4fa94d"
ariaLabel="audio-loading"
wrapperStyle={{}}
wrapperClass="wrapper-class"
visible={true}
/>
)
}Visit our complete documentation for:
- Getting Started Guide - Installation and basic usage
- All Components - Browse all 35+ spinner components
- API Reference - Detailed prop documentation
- Live Examples - Interactive demos
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
import { Oval } from 'react-loader-spinner'
;<Oval
height={80}
width={80}
color="#4fa94d"
visible={true}
ariaLabel="oval-loading"
secondaryColor="#4fa94d"
strokeWidth={2}
strokeWidthSecondary={2}
/>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}
/>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>
)
}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'All spinner components accept these common props:
| Prop | Type | Default | Description |
|---|---|---|---|
height |
string | number |
"100" |
Height of the spinner |
width |
string | number |
"100" |
Width of the spinner |
color |
string |
"#4fa94d" |
Primary color |
visible |
boolean |
true |
Show/hide the spinner |
ariaLabel |
string |
Component-specific | Accessibility label |
wrapperStyle |
CSSProperties |
{} |
Inline styles for wrapper |
wrapperClass |
string |
"" |
CSS class for wrapper |
Note: Individual components may have additional specific props. Check the documentation for each component.
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} />- β Chrome (latest)
- β Firefox (latest)
- β Safari (latest)
- β Edge (latest)
- β Modern mobile browsers
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT Β© Mohan Upadhyay
Thanks goes to these wonderful people:
β Star us on GitHub β it helps!
