storybook/docs/snippets/angular/page-story-with-args-composition.ts.mdx
2022-07-07 19:05:48 +01:00

40 lines
1.2 KiB
Plaintext

```ts
// YourPage.stories.ts
import { Meta, moduleMetadata, Story } 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 {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'DocumentScreen',
component: DocumentScreen,
decorators: [
moduleMetadata({
declarations: [DocumentList, DocumentHeader, PageLayout],
imports: [CommonModule],
}),
],
} as Meta;
export const ExampleWithRole: Story = {
args: {
user: PageLayoutStories.PageLayoutSimple.args.user,
document: DocumentHeaderStories.DocumentHeaderSimple.args.document,
subdocuments: DocumentListStories.DocumentListSimple.args.documents,
},
};
```