addonVis
addonVis() is the default export of storybook-addon-vis.
It returns a preview addon for definePreview().
import addonVis from 'storybook-addon-vis'import { definePreview } from '@storybook/your-framework/node'
export default definePreview({ addons: [addonVis({ auto: true })],})Signature
Section titled “Signature”function addonVis(options?: SetupVisOptions<{ tags: string[] }>): PreviewAddonThe default is { auto: false }.
Options
Section titled “Options”The options are those of vis.setup: auto (a boolean, a function, or an object of themes) and createMissingBaseline.
What it does
Section titled “What it does”- With
auto: true, it adds thesnapshottag to every story. - In a Vitest browser run,
beforeAllprepares the matcher and turns automatic snapshot options on. afterEachtakes the snapshot, once per theme whenautois an object.- It includes
visAnnotations.
It also registers toMatchImageSnapshot on expect when the module loads, so the matcher exists in Storybook dev mode.
See the CSF Next guide.