storybook/docs/snippets/web-components/my-component-story-with-nonstory.js.mdx
2023-01-05 14:53:03 +00:00

26 lines
553 B
Plaintext

```js
// MyComponent.stories.js
export default {
title: 'MyComponent',
component: 'my-component',
includeStories: ['SimpleStory', 'ComplexStory'], // 👈 Storybook loads these stories
excludeStories: /.*Data$/, // 👈 Storybook ignores anything that contains Data
};
export const simpleData = { foo: 1, bar: 'baz' };
export const complexData = { foo: 1, foobar: { bar: 'baz', baz: someData } };
export const SimpleStory = {
args: {
data: simpleData,
},
};
export const ComplexStory = {
args: {
data: complexData,
},
};
```