storybook/docs/snippets/svelte/page-story-with-args-composition.js.mdx
2022-07-07 19:15:02 +01:00

36 lines
1.0 KiB
Plaintext

```js
// YourPage.stories.js
import DocumentScreen from './YourPage.svelte';
//👇 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/svelte/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'DocumentScreen',
component: DocumentScreen,
};
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/7.0/svelte/api/csf
* to learn how to use render functions.
*/
export const SimplePage = {
render: (args) => ({
Component: DocumentScreen,
props: args,
}),
args: {
user: PageLayoutStories.Simple.args.user,
document: DocumentHeaderStories.Simple.args.document,
subdocuments: DocumentListStories.Simple.args.documents,
},
};
```