'@storybook/addon-interactions' Is there a way to turn off autoplay of interactions?

413 Views Asked by At

I want to use '@storybook/addon-interactions' v7.4.0 for some testing. However, I don't want the interactions to run automatically. The reason: The project I am working on will be visible to other parties. I don't want them distracted by the interactions running. https://storybook.js.org/tutorials/ui-testing-handbook/react/en/interaction-testing/

I have tried to find a place to set autoplay: false, but nothing seems to work. I had it in the preview.js, main.js, in the story as a parameter, etc... I am not sure if it is even a prop or parameter that can be set.

1

There are 1 best solutions below

0
Dominik Haas On

Have you tried like this:

export const Basic: Story = {
  parameters: {
    docs: {
      story: { autoplay: true },
    },
  },
};

See: https://github.com/storybookjs/storybook/blob/a3cdabb025524822807318bc137f69be006596c2/docs/snippets/web-components/api-doc-block-story-parameter.ts.mdx#L17