CSS, Lottie or JavaScript: what to animate a website with
Three ways to animate a site: when CSS is enough, when you need Lottie and when JavaScript and canvas. Weight, smoothness and convenience.

The same animation can be built three ways, and the choice affects page weight and smoothness.
CSS
- For: hover, press, reveals, simple loops.
- Pros: weighs almost nothing, stays smooth under load.
- Cons: no complex interactive behavior.
Lottie
- For: illustrations and icons made in After Effects.
- Pros: designers draw it themselves.
- Cons: needs a library, complex files lag on phones.
JavaScript and canvas
- For: particles, physics, cursor reaction, shaders.
- Pros: anything is possible.
- Cons: watch performance.

How to choose
- “Before → after” effect: CSS.
- A drawn illustration: Lottie.
- Reacts to the cursor or has hundreds of particles: JavaScript.
Combine them
Good sites usually use all three: CSS for UI, JavaScript for a couple of showpieces, Lottie for illustrations.
Catalog components use CSS and plain JavaScript with no heavy libraries, so they paste as one block.




