mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
31 lines
627 B
Plaintext
31 lines
627 B
Plaintext
```tsx
|
|
// Page.stories.ts|tsx
|
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
import { Page } from './Page';
|
|
|
|
const meta: Meta<typeof Page> = {
|
|
/* 👇 The title prop is optional.
|
|
* See https://storybook.js.org/docs/7.0/react/configure/overview#configure-story-loading
|
|
* to learn how to generate automatic titles
|
|
*/
|
|
title: 'Page',
|
|
component: Page,
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof Page>;
|
|
|
|
export const CustomFooter: Story = {
|
|
render: (args) => (
|
|
<Page {...args}>
|
|
<footer>{args.footer}</footer>
|
|
</Page>
|
|
),
|
|
args: {
|
|
footer: 'Built with Storybook',
|
|
},
|
|
};
|
|
```
|