Animation with AI: principles and a map of paths
Motion stopped being a “portfolio bonus” a long time ago. Clients expect an animated logo, a video for the landing page, live states in the interface. That used to mean months in After Effects or a dedicated motion designer. Now an agent writes animation in code, a video model brings a frame to life, and builders assemble Lottie files from a description. But without a feel for timing and curves, any of these paths will give you that “floaty” animation people spot a mile away. This topic gives you the vocabulary, the principles and a map: which path to take for which task.
Three paths to motion
A designer working with AI has three fundamentally different ways to get motion. They don’t compete; each has its own territory.
| Path | What you get | Where it’s strong | Where it’s weak |
|---|---|---|---|
| Video model (Veo, Kling, Runway) | a clip from a frame or text | photorealism, people, organic forms, camera moves in real space | text, interfaces, exact numbers, repeatability |
| Code via an agent (HTML/JS, Remotion, HyperFrames) | a video rendered from a program | typography, UI, data, brand, versions for different formats, edits that change “one number” | characters, liquids, photorealism |
| Interface animation tools (CSS, GSAP, Lottie, Rive, Figma Motion) | motion inside the product | micro-interactions, icons, transitions, states | social media videos, long stories |
The first path is covered in “Video generation and editing with AI”. The other two are in the next topics of this chapter: “A motion video in code” and “Interface animation”. The rule for choosing is simple. If the screen needs to show the real world, use a video model. If the screen shows text, interface or data, use code. If the motion lives inside the product, use a tool that exports to the product’s format.
The paths mix well. A common setup: a video model makes a background shot with a person, and the agent layers typography and UI on top in code. The viewer sees a photorealistic scene, and the text stays sharp and editable.
Six principles a designer needs
Disney’s classic “12 principles of animation” were written for characters. For interfaces and motion graphics, six of them apply. These are the ones you need to be able to name in a prompt, because the agent knows these words.
- Timing. How long the motion lasts. Fast reads as light and precise, slow as heavy and important. It’s the main lever for how polished something feels.
- Slow in / slow out (easing). An object accelerates and decelerates instead of moving at a constant speed. Linear motion looks mechanical everywhere except endless scrolling and rotation.
- Anticipation. A short movement in the opposite direction before the main one. A button squeezes slightly before it opens a panel. Without anticipation, the action appears out of nowhere.
- Follow-through. Motion doesn’t freeze instantly: a panel overshoots a little and settles back. That’s exactly what the springs below do.
- Staging. At any moment, attention is on one main thing. If everything moves at once, nothing does. In a video, this means “one new thing on screen every 2–4 seconds.”
- Arcs. Natural motion follows an arc, not a straight line. In UI this is mostly about the cursor and elements flying between areas.
The other six (squash and stretch, exaggeration, secondary action and the rest) come in when characters and mascots appear. Then ask the agent to apply them explicitly, by name.
Timing in numbers
There’s no universal table, but there are reference points that Apple’s and Material’s guidelines agree on.
- Micro-interactions (a button pressed, a toggle flipped): 100–200 ms.
- Regular transitions (a panel opened, a card expanded): 200–300 ms.
- Large, full-screen moves: 300–500 ms.
- Exits are shorter than entrances. Entrances use ease-out (fast start, soft stop), exits use ease-in.
- Anything over 500 ms in an interface is almost always a mistake. The user is waiting, not admiring.
Videos work on a different scale. A headline has to stay long enough to be read: 1.5–3 seconds on screen depending on length. A change of state on screen every 2–4 seconds. The first two seconds decide whether people keep watching.
Easing or spring
An easing curve is a predefined speed graph from start to end: ease-out, cubic-bezier(0.2, 0, 0, 1). The duration is fixed and the result is predictable. That’s ideal for videos, where every frame has to be identical on every render.
A spring isn’t defined by duration but by physics: stiffness, damping, mass. The motion speeds up, overshoots the target a little and settles. You can interrupt a spring halfway and redirect it, and it carries on naturally. That’s why springs are the choice for gestures, dragging and layout changes in an interface. Material 3 Expressive moved to spring tokens, and SwiftUI defines a spring with a duration and bounce pair.

A practical rule from “A motion video in code”: each class of objects gets its own spring. Small UI elements snap with almost no overshoot, panels settle softly, the camera drifts almost imperceptibly, headlines land firmly and hold. If everything overshoots, precision is gone.
Vocabulary a prompt can’t work without
- Frame and fps. A video is a sequence of frames, 30 or 60 per second. In code, timing is set by frame number, not by eyeballing seconds.
- Keyframe. A point where a value is set explicitly. Values between keyframes are calculated automatically.
- Timeline. The time scale with all of a project’s animations. In GSAP and HyperFrames it’s literally an object you can scrub to any point.
- Seek. Jumping the timeline to time t. The key word for rendering with code: if you can draw frame 240 without playing the first 239, the video is deterministic.
- Stagger. Starting the same animation on a group of elements with a small offset. A list that “appears one by one.”
- Loop. The last frame matches the first, and the video wraps around without a jump.
- Animatic. A rough video made of crude blocks with real timing and sound. Timing gets approved here, before polishing.
- Contact sheet. A grid of stills from the video in one image. An agent can’t watch video, but it can look at an image, so critique goes through the contact sheet.
- Safe zone. The margins where a social network’s interface puts its buttons and captions. Text there can’t be read.
Accessibility: motion has to be able to turn off
For some people, motion on screen causes dizziness and nausea. Operating systems have a “reduce motion” setting, and in the browser it’s available through the prefers-reduced-motion media query. WCAG 2.3.3 requires that animation triggered by interaction can be turned off. The right response isn’t “remove everything” but substitute: parallax and fly-ins become a short fade, autoscroll stops, the meaning stays. Ask the agent to make two versions from the start: full and reduced motion. It’s one line in the prompt and one check in review.
How to brief it: states, not effects
This is the main shift in thinking. “Zoom, morph, add particles” is a list of activity. The agent will do it, but you’ll get a video made of effects with no story. A storyboard talks differently: what the viewer knows at every second. Each shot has an entry state, an exit state and a reason to exist. If the agent can’t explain why the fourth shot is needed, the fourth shot gets cut.
00–02 s HOOK one image that holds attention
02–05 s PROBLEM the friction, shown on screen
05–09 s DEMO the product enters through a real interaction
09–13 s PROOF one screen or one number backs up the claim
13–16 s END a clean final state and a readable call to action
The second shift: decisions live in files, not in the chat. The agent reads a half-page motion guide (durations, curves, distances, what’s off-limits) on every run. Without it, the agent fills gaps with the most common defaults: a centered headline on a gradient, everything fading in, glow on the UI. That’s AI slop in motion (see “AI slop”). Ban the defaults in a list, and they disappear.
## Project motion guide
- Durations: micro 150 ms, regular transition 250 ms, large 400 ms
- Curves: enter ease-out cubic-bezier(0.2, 0, 0, 1), exit ease-in
- Springs: UI with no overshoot, panels soft, headlines firm and held for 2 s
- Stagger in lists 40 ms, no more than 8 items
- Off-limits: centered headline on a gradient, everything as a fade, glow on UI, captions in the corners
- Reduced motion: fly-ins replaced with a 150 ms fade
Where AI helps and where it doesn’t yet
It helps with: writing animation in code from a guide, breaking a reference down into timing and transitions, producing ten format variants from one timeline, checking its own frames on a contact sheet. It’s still weak at: character animation with personality, organic forms and liquids in code, precise sync to a complex live-action edit. Those still need After Effects, Cavalry and a motion designer’s hands. The most productive mode: you set the states and critique the frames, the agent writes and renders.
Prompt examples
Split the 12 principles of animation into those needed for interfaces and those needed only for characters. For each of the first group, give an example in a UI transition of up to 300 ms
Here’s a description of my product: [description]. Suggest three paths to an animated promo: a video model, code via an agent, an interface animation tool. For each, say what you’ll get, what you won’t, and how long it will take
Write a motion guide for [brand]: durations for three classes of motion, entry and exit curves, stagger rules, a list of banned defaults and a rule for reduced motion. Format: a half-page markdown file
Here’s a storyboard for a 15-second video: [list of shots]. For each shot, write the entry state, the exit state and why it’s needed. Suggest cutting shots that have no reasonTake one real task involving motion: an animated logo, a screen promo, a transition in an interface. Use the map above to pick a path and write down why that one. Then write a half-page motion guide using the template from this topic: durations, curves, springs, banned defaults, a rule for reduced motion. You’ll need this file in the next two topics.
Sources
- Motion — Human Interface Guidelinesdeveloper.apple.com
Motion with purpose, kept brief, respecting the Reduce Motion setting
- Motion — Material Design 3m3.material.io
Duration and easing tokens, the move to springs in Material 3 Expressive
- prefers-reduced-motiondeveloper.mozilla.org
The media query used to swap motion for a calmer version
- Understanding Success Criterion 2.3.3: Animation from Interactionsw3.org
Animation triggered by interaction must be possible to turn off
- Animation — Remotionremotion.dev
A frame as a function of time: interpolating by frame number
Found a mistake or an outdated fact? Write to hey@iskra.guide