storybook/docs/snippets/angular/my-component-story-configure-viewports.mdx.mdx
2022-07-07 19:05:48 +01:00

36 lines
776 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { MyComponent } from './MyComponent.component';
<Meta
title="MyComponent"
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.
See https://storybook.js.org/docs/7.0/angular/api/csf
to learn how to use render functions.
-->
<Story
name="MyStory"
parameters={{
viewport: {
defaultViewport: 'iphonex',
}
}}
render={() => ({
template: `<MyComponent></MyComponent>`,
})} />
```