sheriffMoose / storybook-extras

Storybook Extras Addons

Home Page:https://master--63c1a45beed1a8f036a44e28.chromatic.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variants seems to do nothing under storybook v7.2.1

iCoderXXI opened this issue · comments

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' },
  },

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'],
    },
  },