
Security News
Meet the Socket Team at RSAC and BSidesSF 2025
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
storybook-addon-variants
Advanced tools
Show all variants of a component in a grid
npm install storybook-addon-variants
// .storybook/main.js
module.exports = {
stories: [...],
addons: ["storybook-addon-variants"],
};
There are two ways to do so:
// /MyComponent.stories.js
// ...rest of code omitted for brevity
// CSF2 syntax example
export const MyStory = Template.bind({})
MyStory.parameters = {
variants: {
enable: true
}
};
// or CSF3 syntax example
export const MyStory = {
parameters: {
variants: {
enable: true
}
}
};
By defining this parameter, this story will always render with all variants, regardless of what you select in the toolbar.
This method is quite useful if you want to have a fixed story that shows all variants in your sidebar. It's particularly useful for visual regression testing, when you want to take snapshots of all variants at once with tools like Chromatic.
FAQs
Show all variants of a component in a grid
The npm package storybook-addon-variants receives a total of 719 weekly downloads. As such, storybook-addon-variants popularity was classified as not popular.
We found that storybook-addon-variants demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.