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

30 lines
565 B
Plaintext

```ts
// MyComponent.stories.ts
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { MyComponent } from './MyComponent.component';
export default {
component: MyComponent,
parameters: {
//👇 The viewports object from the Essentials addon
viewport: {
//👇 The viewports you want to use
viewports: INITIAL_VIEWPORTS,
//👇 Your own default viewport
defaultViewport: 'iphone6',
},
},
};
export const MyStory = {
parameters: {
viewport: {
defaultViewport: 'iphonex',
},
},
};
```