Variants seems to do nothing under storybook v7.2.1
iCoderXXI opened this issue · comments
Andrew commented
Hi!
I've installed variants addon using npm install -D @storybook-extras/variants --legacy-peer-deps
command.
Added '@storybook-extras/variants' to addons section in main.ts, added variants: { enable: true, autoCalculate: true },
to meta.parameters, restarted my storybook and nothing changed in the interface.
I'm trying to get variants of standart MUI button via setting argTypes:
argTypes: {
children: { control: 'text', description: 'Button text' },
variant: { control: 'select', options: ['text', 'contained', 'outlined'] },
size: { control: 'select', options: ['small', 'medium', 'large'] },
color: { control: 'select', options: ['primary', 'secondary', 'success', 'error', 'info', 'warning'] },
disabled: { control: 'boolean' },
href: { control: 'text' },
},
Paul Parton commented
Did you get this resolved @iCoderXXI ?
Did you try specifying which params to include?
parameters: {
variants: {
enable: true,
autoCalculate: true,
groupBy: ['size'],
include: ['size', 'color', 'disabled'],
},
},