mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 08:22:05 +08:00
25 lines
564 B
Plaintext
25 lines
564 B
Plaintext
```ts
|
|
// MyComponent.stories.ts|tsx
|
|
|
|
import { MyComponent } from './MyComponent';
|
|
|
|
// Replace your-framework with the name of your framework
|
|
import type { Meta, StoryObj } from '@storybook/your-framework';
|
|
|
|
/**
|
|
* Story written in CSF 3.0 with auto title generation
|
|
* See https://storybook.js.org/docs/7.0/react/api/csf
|
|
* to learn more about it.
|
|
*/
|
|
const meta: Meta<typeof MyComponent> = {
|
|
component: MyComponent,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof MyComponent>;
|
|
|
|
export const Default: Story = {
|
|
args: { message: 'Hello world!' },
|
|
};
|
|
```
|