mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 05:31:49 +08:00
28 lines
554 B
Plaintext
28 lines
554 B
Plaintext
```tsx
|
|
// Page.stories.ts|tsx
|
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
import { Page } from './Page';
|
|
|
|
type PagePropsAndCustomArgs = React.ComponentProps<typeof Page> & { footer?: string };
|
|
|
|
const meta = {
|
|
component: Page,
|
|
render: ({ footer, ...args }) => (
|
|
<Page {...args}>
|
|
<footer>{footer}</footer>
|
|
</Page>
|
|
),
|
|
} satisfies Meta<PagePropsAndCustomArgs>;
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const CustomFooter = {
|
|
args: {
|
|
footer: 'Built with Storybook',
|
|
},
|
|
} satisfies Story;
|
|
```
|