Beautiful, lightweight loading animations for React - because users deserve delightful waiting experiences! β¨
Transform your loading states from boring to brilliant with this carefully curated collection of CSS-powered animations. Built as a React wrapper for the stunning CSSFx collection, this package brings you 14 gorgeous loading components that are both performant and pixel-perfect.
- π Lightweight & Fast - Pure CSS animations with zero JavaScript overhead
- π― Tree-shakable - Import only what you need to keep bundles small
- π¨ Highly Customizable - Colors, sizes, timing - make it yours!
- π± Responsive Ready - Looks great on every device
- βΏ Accessible - Respects user preferences for reduced motion
- π§ TypeScript Support - Full type safety out of the box
π Live Examples
- π Interactive Demo - Try all components live!
- π Storybook Documentation - Explore every prop and variation
Get up and running in seconds! Install with your favorite package manager:
# npm
npm install react-cssfx-loading
# yarn
yarn add react-cssfx-loading
# pnpm
pnpm add react-cssfx-loading
# bun
bun add react-cssfx-loadingIt's as simple as import and drop! Here's how to get started:
import { BarWave } from "react-cssfx-loading";
// π― Simple and clean
<BarWave />
// π¨ Make it your own
<BarWave
color="#6366f1"
width="80px"
height="60px"
duration="2s"
/>
// π§ Full HTML support - it's just a div with superpowers!
<BarWave
onClick={() => console.log("Loading animation clicked!")}
className="my-spinner"
style={{ margin: "auto" }}
aria-label="Loading content..."
/>Every component is built with flexibility in mind. Here's what you can customize:
| Prop | Type | Default | Description |
|---|---|---|---|
color |
string |
#0d6efd |
π¨ Animation color - any valid CSS color |
width |
string |
varies | π Component width (e.g., "50px", "3rem") |
height |
string |
varies | π Component height (e.g., "50px", "3rem") |
duration |
string |
1s |
β±οΈ Animation speed (e.g., "2s", "500ms") |
className |
string |
- | π·οΈ Additional CSS classes |
style |
CSSProperties |
- | π Inline styles object |
| ...rest | HTMLDivElement |
- | π§ All standard HTML div attributes |
Choose from 14 beautifully crafted loading animations:
BarWave- Elegant wave motionBouncingBalls- Playful bouncing spheresFadingBalls- Smooth fade transitionsFadingDots- Subtle dot sequence
CircularProgress- Classic progress circleCoin- Charming coin flip effectHypnosis- Mesmerizing spiralRing- Clean rotating ringSpin- Simple rotationTwinSpin- Dual rotation magic
FlippingSquare- Dynamic square flipSpinStretch- Stretching rotationFillingBottle- Liquid fill animationMessaging- Chat bubble effect
We love contributions! Feel free to:
- π Report bugs
- π‘ Suggest new animations
- π§ Submit pull requests
- β Star the repo if you find it helpful!
MIT Β© napthedev
Made with β€οΈ for the React community
Making loading states delightful, one animation at a time β¨
