storybook/docs/snippets/angular/component-story-static-asset-with-import.mdx.mdx
2021-08-05 18:51:23 +01:00

24 lines
391 B
Plaintext

```md
<!-- MyComponent.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import imageFile from './static/image.png';
<Meta title="img" />
export const image = {
src: imageFile,
alt: "my image",
};
<Story name="withAnImage">
{{
props: {
src: image.src,
alt: image.alt,
},
template: `<img src="{{src}}" alt="{{alt}}" />`,
}}
</Story>
```