🌀 Spinner-Zilla
A comprehensive React spinner library featuring 13 beautiful, customizable loading animations. Built with TypeScript and Tailwind CSS for modern web applications.
✨ Features
- 🎨 12 unique, customizable spinner components
- 📱 Responsive sizing (sm, md, lg, xl)
- 🎯 Built with TypeScript for type safety
- 🌈 Tailwind CSS integration
- 📦 Zero dependencies (except peer dependencies)
- 🚀 Lightweight and performant
- 📖 Comprehensive Storybook documentation
- ♿ Accessibility-friendly
🚀 Installation
npm install spinner-zilla
yarn add spinner-zilla
pnpm add spinner-zilla
📋 Requirements
This package has the following peer dependencies:
react
: >=16.8.0react-dom
: >=16.8.0tailwindcss
: >=3.0.0
📖 Usage
- Import the CSS and your desired spinner component:
import 'spinner-zilla/dist/index.css';
import { CircleSpinner, RingSpinner, WaveSpinner } from 'spinner-zilla';
- Use it in your React component:
function LoadingState() {
return (
<div className="flex items-center gap-4">
<CircleSpinner size="md" color="text-blue-500" />
<span>Loading...</span>
</div>
);
}
⚠️ Important: Make sure to import the CSS file to enable all animations and styles.
🎨 Available Components
- CircleSpinner: Simple circular loading animation
- ClockSpinner: Clock-like spinner with rotating hands
- DNASpinner: DNA helix-inspired loading animation
- DotSpinner: Multiple dots with bouncing animation
- FlipSpinner: 3D flipping animation effect
- GalaxySpinner: Orbital rings with rotating planets
- HeartbeatSpinner: Pulsating heart animation
- MatrixSpinner: Matrix-inspired digital rain effect
- PulseSpinner: Pulsating circle effect
- SquareSpinner: Multiple squares with rotation
- StarSpinner: Rotating and scaling star animation
- WaveSpinner: Multiple bars with wave animation
⚙️ Props
All spinner components accept the following props:
Prop | Type | Default | Description |
---|
size | 'sm' | 'md' | 'lg' | 'xl' | 'md' | Size of the spinner |
color | string | 'text-blue-500' | Tailwind color class |
className | string | '' | Additional CSS classes |
Size Reference
- sm: 1rem (16px)
- md: 1.5rem (24px)
- lg: 2rem (32px)
- xl: 2.5rem (40px)
🎯 Examples
Basic Usage
import 'spinner-zilla/dist/index.css';
import { CircleSpinner } from 'spinner-zilla';
<CircleSpinner />
Custom Size and Color
import 'spinner-zilla/dist/index.css';
import { RingSpinner } from 'spinner-zilla';
<RingSpinner
size="lg"
color="text-purple-500"
/>
Custom Styling with className
import 'spinner-zilla/dist/index.css';
import { WaveSpinner } from 'spinner-zilla';
<WaveSpinner
size="xl"
color="text-green-500"
className="p-4 bg-gray-100 rounded-lg shadow-inner"
/>
Multiple Spinners
import 'spinner-zilla/dist/index.css';
import { DotSpinner, StarSpinner } from 'spinner-zilla';
<div className="flex gap-4">
<DotSpinner size="sm" color="text-blue-500" />
<StarSpinner size="md" color="text-yellow-500" />
</div>
🎮 Interactive Demo
Visit our Storybook to see all spinners in action and try different configurations.
🛠️ Development
- Clone the repository:
git clone https://github.com/SibilSoren/spinner-zilla.git
- Install dependencies:
npm install
- Start Storybook for development:
npm run storybook
- Build the library:
npm run build
The build process will:
- Generate the JavaScript bundle in the
dist
directory - Extract and process all CSS including Tailwind utilities
- Create TypeScript declaration files
- Bundle all animations and styles into
dist/index.css
🧪 Testing
Run the test suite:
npm test
📝 Contributing
Contributions are welcome! Please read our contributing guidelines to get started.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-spinner
) - Commit your changes (
git commit -m 'Add amazing spinner'
) - Push to the branch (
git push origin feature/amazing-spinner
) - Open a Pull Request
📄 License
MIT
🙏 Credits
🤝 Support
Need help? Feel free to: