storybook/docs/snippets/angular/page-story-with-args-composition.ts.mdx
2021-08-28 01:52:57 +01:00

36 lines
976 B
Plaintext

```ts
// YourPage.stories.ts
import { moduleMetadata } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import DocumentScreen from './YourPage.component';
import DocumentList from './DocumentList.component';
import DocumentHeader from './DocumentHeader.component';
import PageLayout from './PageLayout.component';
//👇 Imports the required stories
import * as PageLayoutStories from './PageLayout.stories';
import * as DocumentHeaderStories from './DocumentHeader.stories';
import * as DocumentListStories from './DocumentList.stories';
export default {
component: DocumentScreen,
decorators: [
moduleMetadata({
declarations: [DocumentList, DocumentHeader, PageLayout],
imports: [CommonModule],
}),
],
};
export const Simple = {
args: {
user: PageLayoutStories.Simple.args.user,
document: DocumentHeaderStories.Simple.args.document,
subdocuments: DocumentListStories.Simple.args.documents,
},
};
```