storybook/docs/snippets/web-components/my-component-story-configure-viewports.js.mdx
2021-11-09 01:41:54 +00:00

29 lines
601 B
Plaintext

```js
// my-component.stories.js
import { html } from 'lit-html';
import './my-component';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
export default {
title: '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 = () => html`<my-component></my-component>`;
MyStory.parameters = {
viewport: {
defaultViewport: 'iphonex'
},
};
```