storybook/docs/snippets/react/page-story-slots.ts.mdx
2021-11-09 01:41:54 +00:00

29 lines
655 B
Plaintext

```ts
// Page.stories.ts|tsx
import React from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { Page } from './Page';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Page',
component: Page,
} as ComponentMeta<typeof Page>;
const Template: ComponentStory<typeof Page> = (args) => (
<Page {...args}>
<footer>{args.footer}</footer>
</Page>
);
export const CustomFooter = Template.bind({});
CustomFooter.args = {
footer: 'Built with Storybook',
};
```