mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 19:31:49 +08:00
21 lines
398 B
Plaintext
21 lines
398 B
Plaintext
```tsx
|
|
// MyComponent.stories.ts|tsx
|
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
import { MyComponent } from './MyComponent';
|
|
|
|
const meta = {
|
|
component: MyComponent,
|
|
} satisfies Meta<typeof MyComponent>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const Basic: Story = {};
|
|
|
|
export const WithProp: Story = {
|
|
render: () => <MyComponent prop="value" />,
|
|
};
|
|
```
|