storybook/docs/snippets/react/page-story-with-args-composition.ts.mdx
2022-07-07 19:47:29 +01:00

31 lines
869 B
Plaintext

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