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

32 lines
698 B
Plaintext

```ts
// MyComponent.stories.ts
import { Story, Meta } from '@storybook/angular/types-6-0';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import MyComponent from './MyComponent.component';
export default {
title: 'Stories',
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',
}
},
} as Meta;
export const myStory: Story<MyComponent> = () => ({
template: '<div></div>'
});
myStory.parameters = {
viewport: {
defaultViewport: 'iphonex'
}
};
```