storybook/docs/snippets/svelte/component-story-static-asset-with-import.native-format.mdx
2021-05-06 20:04:33 +01:00

27 lines
430 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" />
```