Choosing an Animation Workflow: From Web UI Motion to Video Production

    Compare four animation workflows: web UI animation, lightweight vector animation with Lottie, code-driven video with Remotion, and product launch videos. Learn how to choose by deliverable, apply timing and accessibility guidelines, implement each approach, and validate performance and output quality.

    1. Choose Based on the Deliverable

    Before choosing an animation workflow, answer three questions: What will you deliver? What performance and file-size limits apply? Which technologies does your team already know?

    The deliverable determines the workflow; your technology stack determines the learning curve.

    Use these rules as a starting point:

    1. For web interface state changes—page entrances, button feedback, or step-by-step guidance—use web UI animation.
    2. For small, looping icons or loading animations that designers will revise frequently, use lightweight vector animation.
    3. For MP4 files generated in batches from data or templates, use code-driven video.
    4. For a one-off brand or product launch video where shot selection and pacing require editorial judgment, use a video production workflow.

    These approaches can coexist. A website might use CSS for page transitions, Lottie for icons, and Remotion to generate data visualizations for a promotional video. Keep durations and colors consistent so the page does not feel like several unrelated motion systems.

    Workflow Typical deliverables Runtime or production environment Main limitations
    Web UI animation Page entrances, button feedback Modern browsers Large particle systems and complex 3D scenes can drop frames
    Lightweight vector animation Icons, loading animations Browsers, mobile WebViews Bitmaps and complex effects can increase file size
    Code-driven video Data reports, batch-generated short videos Node.js; rendering requires Chromium Not intended for real-time interaction or extensive manual shot editing
    Product launch video Product promotional videos Video editing software Not suitable for automated publishing without human review

    2. Timing, Easing, and Accessibility

    Animation Duration

    Microinteractions, such as button presses and toggle changes, typically take 150–400 milliseconds. Entrance and expansion animations can take 400–600 milliseconds. Animations longer than 800 milliseconds can make users feel that they are waiting.

    These ranges reflect common design guidelines and team experience, not an international standard. Adjust them for target devices and user testing, and keep timing consistent within a page.

    Easing Curves

    Use deceleration (ease-out) for entrances and acceleration (ease-in) for exits.

    Custom curves use cubic-bezier(x1, y1, x2, y2). The x1 and x2 values must fall between 0 and 1; otherwise, the CSS value is invalid. The y1 and y2 values can fall outside that range to create overshoot.

    1. /* Entrance: start quickly, then slow down */
    2. transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    3. /* Exit: start slowly, then accelerate */
    4. transition-timing-function: cubic-bezier(0.42, 0, 1, 1);
    5. /* Subtle overshoot for a small movement */
    6. transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);

    For acceptance testing, an entrance animation should make noticeably more progress in its first half than in its second half. Keep positional overshoot to a few pixels or, at most, the low tens of pixels.

    Staggered Sequences

    When elements appear sequentially, use a 40–80 millisecond interval between adjacent elements. Keep the entire sequence within 600 milliseconds. Longer gaps can make the page look as though its contents are loading one item at a time.

    Reduced Motion and Accessibility

    The operating system’s reduced-motion preference is exposed on the web through the prefers-reduced-motion media query. Alternatives include removing movement while retaining fades, or disabling animation entirely.

    1. @media (prefers-reduced-motion: reduce) {
    2. .reveal {
    3. animation: fade-only 200ms linear forwards;
    4. transform: none;
    5. }
    6. }
    7. @keyframes fade-only {
    8. from { opacity: 0; }
    9. to { opacity: 1; }
    10. }

    Video deliverables also need captions. Under WCAG 2.2 AA, text should have a contrast ratio of at least 4.5:1 against its background, or 3:1 for large text. Large text means at least 18 pt, approximately 24 px, or 14 pt bold, approximately 18.66 px.

    During review, sample the foreground and background colors with a color picker, then verify the ratio with a contrast checker.

    3. Implementing the Four Workflows

    Versions and Environment

    The examples use the following environment:

    • Node.js 20 LTS or later.
    • Current stable versions of Chrome, Edge, Firefox, and Safari.
    • GSAP 3.x, lottie-web 5.x, Remotion 4.x, and FFmpeg 6.x or later.

    After installation, run npm ls gsap lottie-web remotion to inspect installed versions, and commit package-lock.json with the project.

    The examples use common APIs from these major versions. Test them in your target environment before deployment and consult the official documentation for the current stable release.

    Workflow 1: Web UI Animation

    Best for: Hero-section entrances, staggered lists, button feedback, and sequential guidance.

    How it works: Animations of transform and opacity can run on the compositor without recalculating layout on every frame. Animating width, height, top, or left can trigger layout calculations and cause dropped frames on complex pages.

    Save the following as index.html and open it directly in a browser:

    1. <!doctype html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="utf-8">
    5. <meta name="viewport" content="width=device-width, initial-scale=1">
    6. <title>Web Animation Example</title>
    7. <style>
    8. .reveal {
    9. opacity: 0;
    10. transform: translateY(16px);
    11. animation: enter 480ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    12. animation-delay: calc(var(--i) * 60ms);
    13. }
    14. @keyframes enter {
    15. to { opacity: 1; transform: translateY(0); }
    16. }
    17. button { transition: transform 150ms ease-out; }
    18. button:active { transform: scale(0.97); }
    19. @media (prefers-reduced-motion: reduce) {
    20. .reveal { animation: fade-only 200ms linear forwards; transform: none; }
    21. }
    22. @keyframes fade-only {
    23. from { opacity: 0; }
    24. to { opacity: 1; }
    25. }
    26. </style>
    27. </head>
    28. <body>
    29. <ul>
    30. <li class="reveal" style="--i:0">Step 1: Enter your details</li>
    31. <li class="reveal" style="--i:1">Step 2: Confirm the plan</li>
    32. <li class="reveal" style="--i:2">Step 3: Publish</li>
    33. </ul>
    34. <button id="submit">Submit</button>
    35. <script>
    36. document.getElementById('submit').addEventListener('click', (e) => {
    37. e.currentTarget.animate(
    38. [{ transform: 'scale(1)' }, { transform: 'scale(0.96)' }, { transform: 'scale(1)' }],
    39. { duration: 250, easing: 'ease-out' }
    40. );
    41. });
    42. </script>
    43. </body>
    44. </html>

    The third list item starts after a 120-millisecond delay. Adding its 480-millisecond animation gives a total sequence duration of 600 milliseconds.

    For more complex timelines, use GSAP:

    1. npm install gsap@3
    1. import { gsap } from 'gsap';
    2. gsap.timeline({ defaults: { duration: 0.48, ease: 'power2.out' } })
    3. .from('.reveal', { y: 16, opacity: 0, stagger: 0.06 });

    Acceptance checklist

    • Animated properties are limited to transform and opacity.
    • A recording in the DevTools Performance panel shows no sustained frame times above 16.7 milliseconds.
    • With Layout Shift Regions enabled in the Rendering panel, no layout shifts occur during the animation.
    • With the system’s reduced-motion preference enabled, page entrances use fades rather than movement.

    Troubleshooting

    Symptom Possible cause How to investigate
    An element flashes, then disappears Missing forwards causes it to return to its initial state Check the animation’s fill mode
    Animation stutters Layout properties such as width or top are animated, or a large box-shadow is expensive to paint Inspect Layout and Paint time in the Performance panel
    Clicking a button produces no feedback A transparent layer covers the button, or the JavaScript listener targets the wrong element Use document.elementFromPoint in the console to identify the element receiving the hit

    Workflow 2: Lightweight Vector Animation with lottie-web

    Best for: Animated icons, loading indicators, and small branded animations. When the designer revises an animation, you can replace its JSON file.

    Create a project and install the dependency:

    1. npm create vite@latest icon-demo -- --template vanilla
    2. cd icon-demo
    3. npm install lottie-web@5

    Place the designer’s exported Lottie file at public/loading.json. Update the body of index.html:

    1. <div id="icon" style="width:120px;height:120px" aria-hidden="true"></div>
    2. <script type="module" src="/main.js"></script>

    Create main.js:

    1. import lottie from 'lottie-web';
    2. const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    3. const anim = lottie.loadAnimation({
    4. container: document.getElementById('icon'),
    5. renderer: 'svg',
    6. loop: !reduceMotion,
    7. autoplay: !reduceMotion,
    8. path: '/loading.json',
    9. });
    10. anim.addEventListener('data_failed', () => {
    11. console.error('Failed to load the animation. Check the path and JSON format.');
    12. });
    13. window.addEventListener('pagehide', () => anim.destroy());

    Run npm run dev, then open the local address displayed in the terminal.

    Acceptance checklist

    • The JSON file is appropriately sized. Icon animations are often only a few tens of kilobytes; check for embedded bitmaps if a file exceeds 200 KB.
    • Playback is smooth on lower-end devices and in mobile WebViews.
    • The animation instance is destroyed when the page is left, with no lingering console errors.
    • With reduced motion enabled, the animation remains on its first frame.

    Troubleshooting

    Symptom Possible cause How to investigate
    The container is blank Incorrect path or a 404 response Check the Network panel and the filename in public
    The data_failed event fires The JSON is not valid Lottie data Validate the JSON structure
    Some effects are missing The design uses effects or expressions unsupported by lottie-web Simplify the effects in the design tool and test them individually on the target platform

    Workflow 3: Code-Driven Video with Remotion

    Best for: Data report videos, course segments, and template-based short videos generated in batches.

    Environment: Node.js 20 LTS or later. Rendering requires Chromium and the browser components needed by Remotion. If downloads are restricted, consult the official documentation for configuring a local browser.

    Create a project:

    1. npx create-video@latest report-video
    2. cd report-video
    3. npm run dev

    Add the following component to src/Report.tsx. Its animation depends only on the current frame and input props, making the result repeatable:

    1. import { AbsoluteFill, interpolate, useCurrentFrame, useVideoConfig } from 'remotion';
    2. export const Report = ({ value }: { value: number }) => {
    3. const frame = useCurrentFrame();
    4. const { fps } = useVideoConfig();
    5. const fadeIn = interpolate(frame, [0, fps * 0.5], [0, 1], { extrapolateRight: 'clamp' });
    6. const shown = Math.round(
    7. interpolate(frame, [0, fps * 2], [0, value], { extrapolateRight: 'clamp' })
    8. );
    9. return (
    10. <AbsoluteFill
    11. style={{
    12. backgroundColor: '#ffffff',
    13. alignItems: 'center',
    14. justifyContent: 'center',
    15. opacity: fadeIn,
    16. }}
    17. >
    18. <div style={{ fontSize: 96, color: '#111111' }}>{shown}</div>
    19. </AbsoluteFill>
    20. );
    21. };

    Register the composition in src/Root.tsx:

    1. import { Composition } from 'remotion';
    2. import { Report } from './Report';
    3. export const RemotionRoot = () => (
    4. <Composition
    5. id="Report"
    6. component={Report}
    7. durationInFrames={150}
    8. fps={30}
    9. width={1920}
    10. height={1080}
    11. defaultProps={{ value: 1280 }}
    12. />
    13. );

    Render a video, passing data through --props:

    1. npx remotion render Report out/report-1280.mp4 --props='{"value":1280}'

    For batch production, use a shell loop to supply values and limit rendering concurrency with --concurrency to avoid exhausting memory:

    1. for v in 1280 2048 4096; do
    2. npx remotion render Report "out/report-$v.mp4" --props="{\"value\":$v}" --concurrency=2
    3. done

    For web distribution, compress the output:

    1. ffmpeg -i out/report-1280.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart web/report-1280.mp4

    Acceptance checklist

    • Two renders using the same parameters produce identical visual results frame by frame.
    • Components do not use nondeterministic or real-time values such as Date.now or Math.random.
    • Captions and text meet the contrast requirements in Section 2.
    • Font licenses permit their use in rendered videos.

    Troubleshooting

    Symptom Possible cause How to investigate
    Rendering stalls or times out Asynchronous resources have not finished loading Coordinate asynchronous operations with delayRender and continueRender
    Batch rendering runs out of memory Concurrency is too high Lower --concurrency and render in smaller batches
    Two renders produce different results A component reads random values or system time Search for Math.random and Date.now, and replace them with frame-based calculations
    Text uses a fallback font The font file did not load correctly Check the font path and confirm that the license permits video use

    Workflow 4: Product Launch Video Production

    Best for: Product promotions and launch-event segments where shots, pacing, and narration require human judgment.

    AI tools can draft scripts, storyboards, and voiceover text. However, a person must approve the final shot selection, editing rhythm, and brand presentation.

    After exporting the video, create a web version with:

    1. ffmpeg -i final/launch.mov -c:v libx264 -crf 20 -preset slow -c:a aac -b:a 160k -movflags +faststart web/launch.mp4

    For burned-in subtitles, confirm that your FFmpeg build includes libass, then use -vf subtitles=launch.srt.

    Acceptance checklist

    • Captions are synchronized with the video, with appropriate text size and contrast.
    • At least one person outside the production team has watched and reviewed the entire video.
    • License records for narration, music, and other assets are archived.
    • The video contains no unauthorized use of people’s likenesses or brand trademarks.

    4. Frequently Asked Questions

    How long should UI animations last?

    Use 150–400 milliseconds for microinteractions and 400–600 milliseconds for entrance animations. Keep timing consistent across the page, and use user testing to refine the values.

    Should I use Lottie or CSS?

    Choose Lottie when graphics come from a design tool or need frequent design revisions. For simple movement and opacity changes, CSS is sufficient.