On this page
A success checkmark, an interactive mascot, and an onboarding illustration may all move, but they are different engineering problems. Choosing one animation format for all three usually shifts complexity somewhere less visible: runtime code, export restrictions, accessibility, or maintenance.
Classify the behavior before choosing a format
Write down what starts the animation, what interrupts it, and whether the user can change its state while it runs. A timeline that plays after a successful payment has different needs from a character that follows pointer movement and reacts to validation errors.
For vector assets, use the SVG Minifier to inspect and simplify a standalone SVG used in a CSS prototype. Preserve meaningful IDs, viewBox settings, and hooks that the animation needs. The tool does not optimize Lottie JSON or Rive binaries; its role is evaluating the lightweight SVG-and-CSS option fairly.
Define interaction complexity separately from visual complexity. A detailed but passive illustration can be a simple playback problem. A small icon with hover, pressed, loading, cancelled, and error states can require a surprisingly careful interaction model.
Also list ownership. Who edits timing next month? Who tests the export? Who updates the runtime? The micro-interactions guide helps connect motion to feedback, while these delivery questions determine whether the implementation remains supportable after launch.
Choose CSS for motion attached to interface state
CSS is the baseline for transitions on existing elements: button feedback, disclosure arrows, small fades, and transforms. It requires no dedicated animation player, stays close to component styles, and can respond directly to classes, attributes, and user preferences.
Use CSS when the artwork is simple enough to express as DOM or SVG and the state transitions remain understandable. It becomes harder to maintain when a long choreography depends on dozens of manually coordinated delays. That is a complexity signal, not a reason to abandon CSS for every animated icon.
.save-mark {
opacity: 0;
transform: scale(0.9);
transition: opacity 140ms ease-out, transform 140ms ease-out;
}
.save-button[data-state="success"] .save-mark {
opacity: 1;
transform: scale(1);
}
@media (prefers-reduced-motion: reduce) {
.save-mark { transition: none; transform: none; }
}The application still owns the save operation and the accessible success message. The checkmark is a visual reflection of state, not the source of truth. See MDN's CSS animations documentation for the underlying model.
For SVG assets, follow the production SVG guide. Test internal selectors after optimization because removing a group or renaming an ID can break motion even when a static preview looks identical.
Choose Lottie for authored timeline playback
Lottie is useful when a motion designer authors a predominantly timeline-based illustration and engineering needs playback controls rather than hand-rebuilding the choreography. Common examples include onboarding scenes, empty-state illustrations, and short completion flourishes.
An exported animation is not a universal video replacement. Supported features depend on the exporter, player, and renderer. Effects that look correct in an authoring tool may render differently or be unsupported on the target platform. Use the official lottie-web repository as a starting point for implementation and feature constraints.
Prototype the actual exported asset early. Do not approve only a designer's recording and assume the runtime result will match. Check masks, gradients, text treatment, images, and clipping with the renderer you plan to ship.
Lottie can be interactive through playback APIs, segments, and application logic. However, timeline control is not the same as a richly authored state machine. When application code accumulates many rules about which frame segment can follow another, reconsider where that behavioral complexity belongs.
Include the player, the animation data, and any external assets in the delivery budget. A small JSON file can still require substantial rendering work if the scene contains many paths or masks. Evaluate the scene rather than assuming the format implies a particular performance result.
Choose Rive for authored interactive behavior
Rive is a strong candidate when the asset needs reusable states and transitions driven by inputs: a character reacting to form activity, an interactive diagram, or an illustration whose response depends on several product states.
Its editor and runtime model let designers author behavior alongside the artwork. Consult the official Rive documentation for state machines, inputs, supported platforms, and runtime setup. Confirm the APIs for your chosen runtime version instead of copying older integration examples blindly.
Keep the application boundary clear. The runtime may animate a character's success reaction, but the application decides whether the operation succeeded. Avoid embedding payment status, navigation rules, or validation truth exclusively inside an artboard state machine.
An interactive canvas is not automatically an accessible application control. Provide semantic HTML controls and text for essential actions and feedback. The artwork can respond to those controls without becoming the only way to understand or operate the feature.
Rive also introduces runtime and asset-loading considerations, including renderer choice and cleanup. Test multiple instances, resizing, device pixel ratio, and background tabs. Release resources when the component unmounts, and avoid leaving invisible scenes running simply because their container is offscreen.
Compare complete implementations, not file extensions
Build one representative prototype in the two most plausible options. Measure total delivery cost: runtime download, asset bytes, initialization work, sustained frame time, memory, and maintenance. A comparison of only the exported file sizes misses much of the real tradeoff.
Test on the slowest device class that matters to the product. Use the same artwork, dimensions, playback behavior, and visible instance count. A single hero animation on a laptop does not predict a dashboard with twenty looping illustrations on a budget phone.
Specify reduced-motion behavior before handoff. CSS can use a media query; a JavaScript player needs preference-aware playback logic and a response to preference changes. Choose a meaningful static frame or alternate asset instead of freezing unpredictably midway through an explanation.
Provide a loading and failure fallback. Essential instructions must remain readable if the runtime fails or the asset cannot load. For decorative scenes, a static image or no illustration may be adequate. For meaningful diagrams, equivalent text must preserve the information.
Use the design tokens guide to document durations, colors, and state names across the implementation. Deliver a small acceptance checklist: start trigger, loop policy, interruption behavior, static fallback, resource cleanup, and supported platforms. This prevents visual approval from being mistaken for complete product readiness.
Key takeaways
- Use CSS for interface-local transitions and manageable SVG motion.
- Use Lottie when authored timeline playback is the primary requirement.
- Use Rive when interactive authored states justify a dedicated runtime.
- Keep product truth and accessible controls outside decorative assets.
- Compare complete prototypes, including fallbacks and maintenance, before standardizing.
Reach designers & developers at work
Put your product next to the tools people use every day. One sponsor per placement, no tracking pixels.
Become a sponsor