storybook/docs/snippets/react/page-story-slots.ts.mdx
2022-11-17 16:32:02 +01:00

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