storybook/docs/snippets/angular/my-component-story-with-nonstory.ts.mdx
2021-09-06 22:03:15 +01:00

29 lines
617 B
Plaintext

```ts
// MyComponent.stories.ts
import { MyComponent } from './MyComponent.component';
import someData from './data.json';
export default {
component: MyComponent,
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
},
};
```