storybook/docs/snippets/svelte/component-story-static-asset-cdn.js.mdx
2021-05-06 17:36:21 +01:00

20 lines
362 B
Plaintext

```js
// MyComponent.stories.js
import MyComponent from './MyComponent.svelte';
export default {
component: MyComponent,
title: 'img',
};
// Assume image.png is located in the "public" directory.
export const withAnImage = () => ({
Component: MyComponent,
props: {
src: 'https://place-hold.it/350x150',
alt: 'My CDN placeholder',
},
});
```