storybook/docs/snippets/react/component-story-static-asset-with-import.mdx.mdx
2021-11-06 03:20:29 +00: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>
```