storybook/docs/snippets/react/page-story-with-args-composition.ts.mdx
2021-05-06 21:05:56 +01:00

26 lines
699 B
Plaintext

```js
// YourPage.stories.js
import React from 'react';
import { Story, Meta } from '@storybook/react';
import { DocumentScreen, DocumentScreenProps } from './YourPage';
import PageLayout from './PageLayout.stories';
import DocumentHeader from './DocumentHeader.stories';
import DocumentList from './DocumentList.stories';
export default {
component: DocumentScreen,
title: 'DocumentScreen',
} as Meta;
const Template: Story<DocumentScreenProps> = (args) => <DocumentScreen {...args} />;
export const Simple = Template.bind({});
Simple.args = {
user: PageLayout.Simple.args.user,
document: DocumentHeader.Simple.args.document,
subdocuments: DocumentList.Simple.args.documents,
};
```