Skip to main content

Parameters

Sherlo parameters are per-story settings that limit a story to one platform, exclude it from testing, or turn off scroll capture.

Control how each story is tested​

Each story can have a set of parameters that customize the test setup.

ParameterTypeDefaultDescription
platform<Platform.OS>undefinedTest the story only on a specific platform
exclude<boolean>falseSkip the story during testing
disableScrollCapture<boolean>falseDisable scroll capture for scrollable stories
Button.stories.js
export default {
component: Button,
parameters: {
sherlo: {
platform: "android", // Specify the testing platform
exclude: false // Set to true to exclude the story from testing
},
},
};

Platform​

Setting the platform parameter to either "android" or "ios" tests the story only on that specific platform.

Exclude​

Setting exclude to true skips the story during testing.

tip

Before excluding stories, consider using isRunningVisualTests to control rendering behavior.

Scroll capture​

By default, Sherlo automatically captures the full scrollable content of a story as a single stitched screenshot. Setting disableScrollCapture to true captures only the visible viewport instead.

LongList.stories.js
export default {
component: LongList,
parameters: {
sherlo: {
disableScrollCapture: true, // Only capture the visible viewport
},
},
};
info

Very tall stories are automatically truncated at the maximum scroll capture height.