ContactSign inSign up
Contact

Use with globals and params to control snapshot capturing behavior

When using Chromatic with Storybook, you can control how a snapshot is captured via Storybook parameters and globals.

Parameters

Parameters are static metadata that can be attached at the story, component (meta), and project (global) levels. For more information on how to use parameters in Storybook, see: Config with story params.

ParameterTypePurpose
chromatic.delaynumberDelay the capture by specified number of milliseconds.
chromatic.diffIncludeAntiAliasingbooleanInclude anti-aliasing in diffs
chromatic.diffThresholdnumberControl visual sensitivity of diffs, learn more
chromatic.disableSnapshotbooleanSkip test
chromatic.ignoreSelectorsstring[]Ignore elements from diff
chromatic.pauseAnimationAtEndbooleanPause animation at end
chromatic.forcedColorsstringControl CSS forced colors mode
chromatic.prefersReducedMotionstringControl CSS reduce motion setting
chromatic.mediastringEnable CSS print media styles
chromatic.cropToViewportbooleanCrop the screenshot to the viewport, learn more
chromatic.modesobjectApply modes
chromatic.viewportsnumber[]Legacy API for setting viewports for a story. Use Modes instead.

Globals

Globals in Storybook represent “global” (as in not story-specific) inputs that affect how a story is rendered.

GlobalTypePurpose
viewportobjectUse the Storybook viewport feature to control the dimensions of the story
a11yobjectConfigure accessibility tests
Custom globaluser definedCustom globals in modes