mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
28 lines
666 B
Plaintext
28 lines
666 B
Plaintext
```ts
|
|
// src/components/Button/Button.stories.tsx
|
|
|
|
// Replace your-framework with the name of your framework
|
|
import type { Meta, StoryObj } from '@storybook/your-framework';
|
|
|
|
import { Button } from './Button';
|
|
|
|
const meta = {
|
|
// Sets the name for the stories container
|
|
title: 'components/Button',
|
|
// The component name will be used if `title` is not set
|
|
component: Button,
|
|
} satisfies Meta<typeof Button>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
// The story variable name will be used if `name` is not set
|
|
const Primary: Story = {
|
|
// Sets the name for that particular story
|
|
name: 'Primary',
|
|
args: {
|
|
label: 'Button',
|
|
},
|
|
};
|
|
```
|