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

32 lines
844 B
Plaintext

```tsx
// YourPage.stories.ts|tsx
import type { Meta, StoryObj } from '@storybook/react';
import { DocumentScreen } from './YourPage';
import PageLayout from './PageLayout.stories';
import DocumentHeader from './DocumentHeader.stories';
import DocumentList from './DocumentList.stories';
const meta: Meta<typeof DocumentScreen> = {
/* 👇 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: 'DocumentScreen',
component: DocumentScreen,
};
export default meta;
type Story = StoryObj<typeof DocumentScreen>;
export const Simple: Story = {
args: {
user: PageLayout.Simple.args.user,
document: DocumentHeader.Simple.args.document,
subdocuments: DocumentList.Simple.args.documents,
},
};
```