storybook/docs/snippets/common/component-story-auto-title.csf3-story-ts.ts.mdx
2023-01-19 17:44:21 +00:00

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!' },
};
```