storybook/docs/snippets/web-components/list-story-reuse-data.js.mdx
2022-07-07 18:04:56 +01:00

34 lines
946 B
Plaintext

```js
// demo-list.stories.js
import { html } from 'lit-html';
import './demo-list';
import './demo-list-item';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/web-components/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'List',
};
//👇 We're importing the necessary stories from ListItem
import { Selected, Unselected } from './demo-list-item.stories';
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/7.0/web-components/api/csf
* to learn how to use render functions.
*/
export const ManyItems = {
render: (args) => html`
<demo-list>
${Selected({ ...args, ...Selected.args })} ${Unselected({ ...args, ...Unselected.args })} ${Unselected(
{ ...args, ...Unselected.args }
)}
</demo-list>
`,
};
```