autoSyncAnimations, Helios automatically controls all CSS animations on the page, making them frame-perfect and renderable.
Overview
The React CSS animation example shows how to:- Use standard CSS keyframes with React
- Enable automatic animation synchronization
- Create declarative animations without hooks or refs
- Build reusable animated components
Setup
How it works
Auto sync animations
When you enableautoSyncAnimations: true, Helios:
- Intercepts CSS animations: Automatically detects and controls all CSS animations and transitions
- Synchronizes timing: Binds animation progress to the Helios timeline
- Enables seeking: Allows jumping to any point in the animation
- Frame-perfect rendering: Ensures consistent output for video export
No hooks required
Unlike imperative animation approaches, CSS animations with Helios are completely declarative:useVideoFramehookuseReffor elements- Manual animation calculations
- Effect hooks for initialization
React integration benefits
- Component-based: Encapsulate animations within components
- Reusable: Share animated components across projects
- Props-driven: Control animations with component props
- SSR compatible: Works with server-side rendering
Advanced patterns
Conditional animations
Use props to conditionally apply animation classes:Multiple animations
Combine multiple animations on a single element:Animation composition
Sequence animations using delays:Key concepts
- autoSyncAnimations: Helios automatically controls all CSS animations
- Declarative approach: Use className instead of imperative animation code
- Zero hooks: No need for useVideoFrame or useRef
- Standard CSS: Use regular @keyframes and animation properties
Performance considerations
- GPU acceleration: Use transform and opacity for best performance
- Avoid layout triggers: Don’t animate width, height, or position
- Will-change: Add
will-changefor complex animations - Animation count: Limit simultaneous animations for smooth playback
Complete example
View the complete source code in the react-css-animation directory.Next steps
- Try Framer Motion for more powerful React animations