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

31 lines
510 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { MyComponent } from './MyComponent';
<Meta
title="MyComponent"
parameters={{
viewport: {
viewports: INITIAL_VIEWPORTS,
defaultViewport: 'iphone6',
},
}}
component={MyComponent}
/>
<Story
name="MyStory"
parameters={{
viewport: {
defaultViewport: 'iphonex',
},
}}>
<MyComponent />
</Story>
```