storybook/docs/snippets/svelte/component-story-static-asset-with-import.native-format.mdx
2022-11-17 16:33:22 +01:00

25 lines
428 B
Plaintext

```html
<!-- MyComponent.stories.svelte -->
<script>
import { Meta, Template, Story } from '@storybook/addon-svelte-csf';
import MyComponent from './MyComponent.svelte';
import imageFile from './static/image.png';
let image = {
src: imageFile,
alt: 'my image',
};
</script>
<meta title="img" component="{MyComponent}" />
<template>
<MyComponent {image} />
</template>
<Story name="WithAnImage" />
```