storybook/docs/snippets/svelte/component-story-static-asset-with-import.js.mdx
2021-05-07 18:07:39 +01:00

24 lines
348 B
Plaintext

```js
//MyComponent.stories.js
import MyComponent from './MyComponent.svelte';
import imageFile from './static/image.png';
export default {
component: MyComponent,
title: 'img',
};
const image = {
src: imageFile,
alt: "my image",
};
export const WithAnImage = () => ({
Component: MyComponent,
props: {
image: image
},
});
```