storybook/docs/snippets/svelte/my-component-story-configure-viewports.mdx.mdx
2021-10-11 19:53:39 +01:00

32 lines
645 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import MyComponent from './MyComponent.svelte';
<Meta
title="Stories"
parameters={{
viewport: {
viewports: INITIAL_VIEWPORTS,
defaultViewport: 'iphone6',
},
}}
component={MyComponent} />
<!-- Render functions are a framework specific feature to allow you control on how the component renders -->
<Story
name="MyStory"
parameters={{
viewport: {
defaultViewport: 'iphonex',
}
}}
render={() => ({
Component: MyComponent,
})} />
```