mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
22 lines
671 B
Plaintext
22 lines
671 B
Plaintext
```html
|
|
<!-- MyComponent.stories.svelte -->
|
|
|
|
<script>
|
|
import { Meta, Template, Story } from '@storybook/addon-svelte-csf';
|
|
|
|
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
|
|
|
|
import MyComponent from './MyComponent.svelte';
|
|
</script>
|
|
|
|
<Meta title="MyComponent" 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', }, }} />
|
|
|
|
<template let:args>
|
|
<MyComponent {...args} />
|
|
</template>
|
|
|
|
<Story name="MyStory" parameters={{ viewport: { defaultViewport: 'iphonex', }, }} />
|
|
```
|