storybook/docs/snippets/react/component-story-static-asset-without-import.ts.mdx
2023-05-25 21:04:33 +01:00

20 lines
436 B
Plaintext

```tsx
// MyComponent.stories.ts|tsx
import type { Meta, StoryObj } from '@storybook/react';
import { MyComponent } from './MyComponent';
const meta: Meta<typeof MyComponent> = {
component: MyComponent,
};
export default meta;
type Story = StoryObj<typeof MyComponent>;
// Assume image.png is located in the "public" directory.
export const WithAnImage: Story = {
render: () => <img src="/image.png" alt="my image" />,
};
```