Skottie Component
TheSkottie component renders Lottie animations on the canvas.
Props
| Name | Type | Description |
|---|---|---|
| animation | SkSkottieAnimation | Compiled animation from Skia.Skottie.Make() |
| frame | number | The frame to display (can be animated) |
Basic Example
Creating Animations
Load Lottie JSON data usingSkia.Skottie.Make():
With External Assets
Many Lottie animations include external assets like fonts and images:Animated Playback
Combine Skottie with Reanimated for smooth animation:Animation Properties
Basic Information
Get information about your animation:Dynamic Properties
Skottie allows runtime modification of animation properties without recreating the animation.Color Properties
Modify colors programmatically:Text Properties
Change text content and size:Opacity Properties
Control opacity:Transform Properties
Modify transforms:Slot Management
Slots are designer-created placeholders for dynamic content replacement.Getting Slot Information
Setting Slots
Color Slots
Text Slots
Scalar Slots
Vec2 Slots
Image Slots
Getting Slot Values
Complete Example with Dynamic Properties
Applying Effects
Skottie components don’t follow standard painting rules. Use thelayer property:
With Color Matrix
Direct Rendering (Advanced)
For advanced use cases, render directly to a surface:Performance Tips
- Cache animations outside render when possible
- Reuse animation instances for multiple components
- Use appropriate scaling to avoid large draw areas
- Limit the number of simultaneous animations
- Consider using static frames for non-animated states
- Optimize Lottie files before exporting from After Effects
Troubleshooting
Animation Not Loading
- Verify JSON is valid Lottie format
- Check that
Skia.Skottie.Make()didn’t returnnull - Ensure JSON is stringified before passing to
Make()
Missing Assets
- Provide all external assets in the assets object
- Check asset names match exactly
- Verify font and image data is properly loaded
Performance Issues
- Reduce animation complexity in After Effects
- Scale down animation dimensions
- Limit frame rate
- Use fewer simultaneous animations
- Consider using video for complex animations
Property Changes Not Visible
- Set properties before rendering first frame
- Verify property keys match animation structure
- Check property value types and ranges
Common Patterns
Loading State
Controlled Playback
See Also
- Animated Images - GIF and WebP animations
- Pictures - Recording drawing commands
- SVG - Vector graphics
- Video - Video playback