fbredius/storybook

View on GitHub
docs/snippets/react/page-story-slots.ts.mdx

Summary

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