Animation System
Anicon uses Framer Motion to power all icon animations. Every icon features carefully crafted animations that respond to user interactions while respecting accessibility preferences.Core Animation Principles
Purposeful Motion
Every animation has a purpose - to provide feedback, guide attention, or enhance the user experience.
Accessibility First
All animations automatically respect
prefers-reduced-motion settings.Physics-Based
Spring-based animations feel natural and responsive.
Performance Optimized
Animations use GPU-accelerated transforms for smooth 60fps performance.
Animation States
Most Anicon components respond to three interaction states:Rest State
The default state when the icon is not being interacted with.Hover State
Triggered when the user hovers over the icon (desktop/pointer devices).Tap State
Triggered when the user clicks/taps the icon (all devices).Animation Configuration
Anicon includes a centralized animation configuration file that ensures consistent behavior across all icons.Transition Presets
Pre-configured transition types for different animation needs.Standard spring for most interactions.Use for: General hover and tap interactions, smooth movements.
Bouncier spring for playful effects.Use for: Hearts, stars, celebratory icons.
Quick spring for snappy feedback.Use for: Quick tap responses, UI controls.
Tween for linear/predictable animations.Use for: Rotations, continuous animations, loaders.
Fast tween for tap responses.Use for: Quick state changes, button presses.
Movement Distances
Standardized distances for icon movement animations.Small movement distance (3px) - subtle shifts.
Medium movement distance (5px) - noticeable motion.
Large movement distance (8px) - prominent shifts.
Example Usage
Rotation Amounts
Standardized rotation angles for consistent spinning effects.Small rotation (15°) - subtle tilt.
Medium rotation (45°) - noticeable turn.
Large rotation (90°) - quarter turn.
Full rotation (360°) - complete spin.
Example Usage
Scale Factors
Standardized scale values for grow and shrink effects.Standard shrink scale - noticeable reduction.
Small shrink scale - subtle reduction.
Standard grow scale - noticeable enlargement.
Small grow scale - subtle enlargement.
Large grow scale - prominent enlargement.
Example Usage
Shake & Ring Sequences
Pre-defined animation sequences for shake and ring effects.Ring animation sequence for bells and alerts.Creates a back-and-forth ringing motion that gradually settles.
Shake animation sequence for errors or alerts.Creates a rapid horizontal shake.
Subtle wiggle animation.Creates a gentle side-to-side motion.
Bell Icon Example
Animation Durations
Standardized timing values for consistent pacing.Fast duration (200ms) - quick responses.
Normal duration (300ms) - standard animations.
Slow duration (500ms) - deliberate movements.
Ring duration (600ms) - bell and shake animations.
Real-World Examples
Let’s examine how actual Anicon components implement animations.Example 1: IconHeart
A simple scale animation with hover and tap states.icon-heart.tsx
- Infinite beating animation on hover
- Respects
prefers-reduced-motion - Simple, effective motion
Example 2: IconBell
A ringing animation using sequence values.icon-bell.tsx
- Ringing animation sequence
- Custom transform origin (top center)
- Different sequences for hover vs tap
Example 3: IconLoader
A continuous rotation animation.icon-loader.tsx
- Continuous infinite rotation
- Linear easing for smooth spinning
- Always animating (not interaction-based)
Accessibility: Reduced Motion
All Anicon components automatically respect the user’s motion preferences using Framer Motion’suseReducedMotion() hook.
How It Works
- User Preference Detection: The hook checks the system-level
prefers-reduced-motionmedia query - Conditional Animation: If reduced motion is preferred, animations are disabled
- Fallback States: Icons render in their static “rest” state when animations are disabled
You don’t need to do anything special - this behavior is built into every Anicon component automatically.
Animation Best Practices
Use Appropriate Transition Types
Use Appropriate Transition Types
- Springs for natural, physics-based interactions (hover, tap)
- Tweens for predictable, linear motions (rotations, progress)
- Linear easing for continuous animations (loaders, spinners)
Keep Animations Short
Keep Animations Short
Most animations should be under 500ms:
- 200ms for quick feedback (taps)
- 300ms for standard transitions (hovers)
- 500-600ms for playful effects (rings, bounces)
Set Appropriate Transform Origins
Set Appropriate Transform Origins
Use
originX and originY to control where animations pivot:Animate Transform Properties
Animate Transform Properties
For best performance, animate transform properties:
scale- for grow/shrink effectsrotate- for spinning/tiltingx,y- for sliding/shiftingopacity- for fading
width, height, top, left.Test with Reduced Motion
Test with Reduced Motion
Always test your implementation with reduced motion enabled:macOS: System Preferences → Accessibility → Display → Reduce motion
Windows: Settings → Ease of Access → Display → Show animations
Browser DevTools: Chrome/Edge have emulation options
Customization
While Anicon components come with pre-built animations, you can wrap them in your own motion components for custom behavior:Next Steps
Props Reference
Learn about all available component props
Icon Categories
Browse all 572+ animated icons
Framer Motion Docs
Explore Framer Motion documentation for advanced animations