mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 08:01:54 +08:00
20 lines
436 B
Plaintext
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" />,
|
|
};
|
|
```
|