{ frame, fps, delay?, spring? } and return CSSProperties. Spread them onto any element’s style prop.
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
frame | number | required | Current frame from useCurrentFrame() |
fps | number | required | FPS from useVideoConfig() |
delay | number | 0 | Delay in seconds before animation starts |
spring | SpringPreset | varies | Spring preset name (see defaults per animation below) |
fadeUp
Fades in while moving up 20px. The default go-to for text and UI elements.- Default spring:
'snappy'
fadeDown
Fades in while moving down 20px. Good for dropdown menus and secondary info.- Default spring:
'snappy'
slideInLeft / slideInRight
Slides in 30px from the left or right with fade. Good for side-by-side comparisons.- Default spring:
'snappy'
popIn
Spring-based scale entrance (0.5 to 1) with bounce. Great for badges, icons, and CTAs.- Default spring:
'bouncy'
blurIn
Fades in from blurry to sharp. Cinematic feel, good for hero text.- Default spring:
'smooth'
elasticScale
Wobbly spring scale entrance. Playful and attention-grabbing.- Default spring:
'wobbly'
perspectiveRotateIn
3D rotation entrance from below. Dramatic, good for cards and panels.- Default spring:
'smooth'
Default springs per animation
| Animation | Default Spring |
|---|---|
fadeUp | 'snappy' |
fadeDown | 'snappy' |
slideInLeft | 'snappy' |
slideInRight | 'snappy' |
popIn | 'bouncy' |
blurIn | 'smooth' |
elasticScale | 'wobbly' |
perspectiveRotateIn | 'smooth' |
Staggering multiple elements
Use thedelay parameter to create staggered entrances:
Combining with inline styles
Since animations returnCSSProperties, spread them alongside your own styles: