October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Reduce Chromatic Snapshot Changes Caused by Animations

Chromatic pauses CSS motion by default, but JavaScript animations need their own test configuration or a verified completion state. Learn which setting to use and when.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Chromatic already pauses CSS transitions and CSS/SVG animations. For CSS animations, it captures the last frame by default; set chromatic.pauseAnimationAtEnd: false when the starting frame is the intended reference. JavaScript-driven animations need a separate fix: disable them in visual-test runs or make the test wait for a verified stable state.

First identify what is moving

The right fix depends on whether the changing pixels come from CSS, JavaScript, or animated media. Chromatic’s animation guidance describes different capture behavior for each, so start by identifying the mechanism rather than adding a delay to every story. See Chromatic’s animation documentation.

As an Amazon Associate I earn from qualifying purchases.

  • CSS transitions and CSS/SVG animations: Chromatic pauses these automatically.
  • JavaScript animation libraries: Chromatic does not disable them automatically. Configure the library for visual tests or synchronize capture with the intended state.
  • GIFs and videos: Chromatic pauses animated GIFs and videos at their first frame. If a video has a poster, Chromatic uses that image.

Animation can still be the intended behavior under test. In that case, do not suppress or omit it; instead, make the test capture a deliberate state.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the intended frame for CSS animation

Chromatic’s default CSS animation behavior pauses at the end of the animation cycle, which is often appropriate for an entrance animation whose completed appearance is the expected snapshot. To capture the starting frame instead, set pauseAnimationAtEnd: false.

For Storybook, configure the chromatic parameter at the narrowest useful scope: on an individual story, a component’s meta, or project-wide in Storybook parameters. For example, at story scope:

export const MyStory = {
  parameters: {
    chromatic: { pauseAnimationAtEnd: false },
  },
};

Use this only where the first frame is the correct reference. A project-wide setting changes the frame choice for all affected stories. Chromatic says this option became enabled by default with Capture Stack version 6 general availability in February 2024; projects that adopted that behavior may therefore differ from older captures. Check the Storybook parameters and globals reference for supported configuration and scope.

Make JavaScript animation deterministic

Disable motion in visual-test runs when animation is not under test

If a story uses Framer Motion 10.17.0 or newer, Chromatic documents using isChromatic() to detect a Chromatic run and set Framer Motion’s MotionGlobalConfig.skipAnimations. Follow the current integration guidance for the exact import and setup in your project, and apply the setting only in the visual-testing environment if normal user-facing motion should remain unchanged.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Other JavaScript animation libraries have their own controls; use the library’s supported test or reduced-motion configuration rather than assuming Chromatic will pause its timers or animation loop.

Wait for a meaningful completed state

If the animation represents behavior the story is testing, let it run and assert that its result is ready before capture. In a Storybook interaction test, Chromatic waits for the story’s play function to finish, including its interactions, assertions, and delays. A state assertion in that function can therefore gate the snapshot:

export const OpensPanel = {
  play: async ({ canvas, userEvent }) => {
    await userEvent.click(canvas.getByRole('button', { name: 'Open panel' }));
    await expect(canvas.getByRole('region', { name: 'Details' })).toBeVisible();
  },
};

Use the assertion that represents the behavior you need—for example, an element becoming visible or a completion marker appearing—rather than treating elapsed time alone as proof that the right state has been reached. Chromatic’s snapshot documentation explains capture timing and interaction tests.

Use waits and capture options for the problem they solve

  • chromatic.delay: waits for a specified time before capture. It can help when no reliable condition is available, but it remains time-based; choose a duration based on the actual animation and runtime, not as a universal value.
  • chromatic.prefersReducedMotion: changes the reduced-motion preference for the capture. Use it when the story is meant to render its reduced-motion state; it is not a general guarantee that every JavaScript animation will stop.
  • chromatic.ignoreSelectors: excludes matching regions from visual comparison. Use it only when those pixels are not part of what the story is supposed to verify.

These settings solve different problems: waiting gives an animation time to reach a state, reduced motion changes a browser preference, and ignored selectors remove pixels from comparison. See the parameter reference for supported Storybook parameters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why network idle does not necessarily mean animation complete

Chromatic uses network quiescence in part as a signal that page resources have loaded. Network inactivity does not guarantee that JavaScript-driven motion has finished. If capture timing matters, establish readiness with a condition, an explicit completion marker, or the end of the Storybook play function rather than relying on network idle alone.

Disable snapshots only when capture itself is unwanted

chromatic.disableSnapshot can disable a Storybook snapshot at story, component, or project level. For Vitest, Playwright, and Cypress integrations, disableAutoSnapshot disables the default end-of-test snapshot when you are taking targeted snapshots instead. These controls suppress capture; they do not make an animation deterministic. Use them when a default snapshot is not wanted, not as a substitute for testing a stable state. See Chromatic’s snapshot-disabling guidance.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot changing snapshots

The animated element is CSS-based but snapshots still differ

Confirm that the motion is actually CSS animation, transition, or CSS/SVG animation rather than being driven by JavaScript. Then decide whether the first or last frame is correct and set pauseAnimationAtEnd only if the default final frame is not the intended state. Check whether the animation’s changing output is genuinely part of the visual requirement.

A JavaScript animation is caught mid-motion

Chromatic does not automatically disable JavaScript-driven animation. Turn it off for visual-test runs where motion is irrelevant, or wait for an observable final state before the snapshot. A delay may mask the symptom but can remain unreliable if runtime or animation duration varies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A video or GIF differs from the expected CSS behavior

Media uses separate behavior: Chromatic pauses animated GIFs and videos at the first frame, and uses a video’s poster when available. Do not expect the CSS animation last-frame setting to select a video’s frame.

An older project captures a different CSS frame

Review when the project adopted Chromatic’s Capture Stack behavior. The animation guide says pauseAnimationAtEnd became enabled by default with Capture Stack version 6 general availability in February 2024. If the intended baseline is the starting frame, set the option to false at the appropriate scope.

Or skip the browser setup

For a standalone website screenshot rather than a Chromatic Storybook snapshot, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed; and AI agents can use its MCP server to take screenshots. It includes 1,000 screenshots per month free with no card, and paid plans start at $5 for 3,000.

For API details and options, see the ScreenshotNeo documentation. cURL example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Sign up for 1,000 free screenshots a month, with no card required.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.