storybook/docs/snippets/react/component-story-static-asset-with-import.mdx.mdx
2021-08-08 18:33:11 +01:00

18 lines
307 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'>
<img src={image.src} alt={image.alt} />;
</Story>
```