Interface animation: CSS, GSAP, Lottie and Rive
A video lives apart from the product, while interface animation lives inside it: a button that responds when you press it, an icon that turns from “menu” into “close,” a transition between screens. Designers used to draw this in After Effects, and a developer rebuilt it from the video and got “almost there.” Now the path is shorter: Figma Motion exports code, an agent writes CSS and GSAP from your motion guide, and Lottie and Rive get built from a description. Your job is to pick the format, set the rules and check how it feels.
Four formats motion lives in
| Format | What it is | Where it lives | When to use it |
|---|---|---|---|
| CSS and View Transitions | motion using the browser’s own tools | any website and web app | transitions, hover, entrances, state changes without JS |
| GSAP and Motion | JS libraries with timelines, springs, scroll | web, React | complex sequences, scroll stories, SVG morphing |
| Lottie (.json, .lottie) | vector animation in a file, played by a player | web, iOS, Android, Figma | icons, illustrations, loaders that need to look the same on every platform |
| Rive (.riv) | animation with a state machine that responds to data and events | web, mobile, games | characters, interactive illustrations, elements that change with user actions |
The main criterion is who will play it back. If the animation lives inside a web page and a developer is nearby, use CSS or GSAP: it’s code the agent writes and edits. If the same icon is needed on web, iOS and Android, use Lottie. If an element has to respond to actions (hover, input, data), use Rive or a dotLottie state machine.
From Figma to code: Figma Motion
Since summer 2026, Figma has a keyframe timeline right on the canvas. You can export an animation to CSS, JSON, React and motion.dev, to video and GIF, and since fall to Lottie as well. In Dev Mode, a developer sees the timing, curves and keyframes. An agent gets the same information through the Figma MCP with the get_motion_context command: a list of animated layers, keyframes and ready CSS snippets (see “AI inside Figma”).

This changes handoff. Motion used to be handed off as a video and the words “something like this.” Now numbers are handed off: duration, curve, delay. A developer or an agent rebuilds them in code one to one. The limitation: animating through the Figma agent, publishing animated components and exporting at high resolution all require a paid seat.

CSS and View Transitions: the cheapest path
Most interface motion can be done without libraries. transition for property changes, @keyframes for sequences, prefers-reduced-motion for accessibility. The View Transitions API handles transitions between states and even between pages: the browser captures “before” and “after” itself and animates the difference. Transitions within a single page work in all modern browsers; between pages, in Chrome and Safari, with partial support in Firefox so far.
The agent writes this well if it has the motion guide from “Animation with AI”. Without a guide, it’ll put ease at 300 ms everywhere. A short prompt with numbers fixes that:
Add transitions following the motion guide in motion.md: panel opens in 250 ms ease-out, closes in 180 ms ease-in, list items appear with a 40 ms stagger. For prefers-reduced-motion, replace fly-ins with a 150 ms fade. CSS only, no libraries
GSAP and Motion: when you need a timeline
GSAP is the standard for complex web motion: timelines, ScrollTrigger for scroll stories, SplitText for letter animation, MorphSVG for turning one shape into another. Since version 3.13 all of it is free, including for commercial use: Webflow bought GSAP and opened up the plugins. Motion (formerly Framer Motion) is closer to React and springs: layout animation, gestures, interruptible transitions. Motion has an official MCP server with its documentation, so the agent uses the current API instead of what it remembers.
What a designer needs this for: scroll stories on a landing page, sections appearing, a hero with a morphing logo, counters that “tick up.” It’s the same vibe coding as in “Vibe coding: websites”, just with a timeline. A key detail from “A motion video in code”: a GSAP timeline can seek to any point, so you can render the same animation into a social video through HyperFrames.
Build a hero section in GSAP: the logo assembles from three shapes (MorphSVG) in 600 ms, the headline appears word by word (SplitText, 60 ms stagger), and on scroll the cards slide in via ScrollTrigger. Curves and durations from motion.md. One timeline that can be scrubbed to any second
Lottie: one animation for every platform
Lottie is vector animation in a JSON file, played by a player on the web, iOS and Android. The classic path: After Effects with the Bodymovin plugin. The new path: Lottie Creator from LottieFiles builds the animation in the browser, and Motion Copilot makes it from a description: “a bell icon sways and sends out two waves.” The result is editable: layers, curves, loops, not a baked video. There’s also an MCP for Lottie Creator, so an agent can build the animation itself.

The .lottie format (dotLottie) packs several animations and themes into one file and supports state machines: inputs, transitions, actions. That lets a “like” icon respond to a click with no code around it. The state machine API is still changing, so pin the player version.
Lottie’s limits: not every After Effects effect exports (expressions, blurs, many effects), and heavy files stutter on mobile. Test in the target player, not in the preview.
Rive: animation that responds
Rive makes interactive animation with a state machine: a character or element has states (idle, hover, pressed, error), transitions between them and inputs that switch them from code. Data binds directly: a counter in the animation reads a number from the app. Since 2026 the editor has scripting and an AI agent that writes scripts, layouts, data models and animation and shows its edits as a diff for you to accept or reject.
For a designer, this is the path to living mascots, interactive onboarding and elements that respond to the user. The barrier to entry is higher than with Lottie: you have to think in states. But it’s the same logic as in “A motion video in code”: a list of states, each with an entry, an exit and a reason.
Critiquing interface animation
A video is critiqued on a contact sheet; an interface, with your hands and eyes. A checklist:
- Motion faster than 100 ms can’t be seen, slower than 500 ms gets annoying. Measure it; don’t guess.
- Entrances are softer than exits. Exits are faster than entrances.
- One main thing moves. If the background, icons and heading also move when a panel opens, keep only the panel.
- Animation doesn’t block action: the button can be pressed while it’s appearing.
- Turn on “reduce motion” in the system settings and go through the flow again. Is the meaning still there?
- Run it on a low-end phone. A 2 MB Lottie and GSAP with a hundred elements will behave differently there.

You can hand part of the check to the agent: “record the transition, pull frames every 50 ms, and tell me where the duration and curve don’t match motion.md.” It’s the same contact sheet idea, just at a millisecond step.
Command examples for practice
Read motion.md and add transitions for all interactive states in the [name] component: hover, pressed, disabled, loading. CSS only. A separate block for prefers-reduced-motion
Hook up View Transitions for the transition between the list and the card: the card grows out of its row in the list. Tell me which browsers this will work in and where it will fall back to regular navigation
Build a scroll story with GSAP ScrollTrigger from four sections: each one pins until its text has been read, and numbers tick up as they appear. Durations from motion.md, no Math.random
A 48×48 bell icon: sways left and right twice in 600 ms, two waves spread out from the top and fade. Loop with a 2 s pause. Two colors: #1A1A1A and #FF5A1F
Here’s a description of an interactive element: [description]. Break it down into states for a Rive state machine: state name, what’s on screen, which inputs move it to other states, and the duration of each transitionTake one element from your design: an icon, a button or a transition between screens. Pick the format from the table and explain your choice in one sentence. Animate it following your motion guide: through Figma Motion with CSS export, through an agent in code, or through Lottie Creator. Turn on reduced motion and check that the meaning holds. Put the result in the prototype or next to the design and show it to a developer: the question “so how exactly does this move?” shouldn’t come up anymore.
Sources
- Introducing Figma Motionfigma.com
A timeline on the Figma canvas, export to CSS, motion.dev, video and Lottie; open beta since June 2026
- Explore Figma Motionhelp.figma.com
What’s available on all plans and what needs a paid seat
- GSAP 3.13: free for everyonegsap.com
All GSAP plugins are free after the Webflow acquisition
- Motion: AI and LLM documentationmotion.dev
An MCP server with Motion documentation for agents
- dotLottie: State Machinesdocs.lottiefiles.com
States and inputs inside a .lottie file
- Introducing Motion Copilot on Lottie Creatorlottiefiles.com
A Lottie animation from a text description, with editable layers
- Rive AI Agentrive.app
An agent inside the Rive editor writes scripts, layouts and animation
- View Transitions APIdeveloper.chrome.com
Transitions between states and pages using the browser’s own tools
Found a mistake or an outdated fact? Write to hey@iskra.guide