storybook/docs/snippets/svelte/my-component-story-configure-viewports.js.mdx
2021-05-07 18:07:39 +01:00

32 lines
629 B
Plaintext

```js
// MyComponent.stories.js
import MyComponent from './MyComponent.svelte';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
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',
},
},
};
export const MyStory = (args) => ({
Component: MyComponent,
props: args,
});
MyStory.parameters = {
viewport: {
defaultViewport: 'iphonex',
},
};
```