mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 23:02:00 +08:00
25 lines
572 B
Plaintext
25 lines
572 B
Plaintext
```ts
|
|
// Button.stories.ts|tsx
|
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
import { Button } from './Button';
|
|
|
|
const meta = {
|
|
component: Button,
|
|
} satisfies Meta<typeof Button>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
/*
|
|
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
* See https://storybook.js.org/docs/api/csf
|
|
* to learn how to use render functions.
|
|
*/
|
|
export const Primary: Story = {
|
|
name: 'I am the primary',
|
|
render: () => <Button primary label="Button" />,
|
|
};
|
|
```
|