storybook/docs/snippets/react/list-story-expanded.ts.mdx
Norbert de Langen c0240f8ec5
changes
2022-06-21 18:30:05 +02:00

35 lines
819 B
Plaintext

```ts
// List.stories.ts|tsx
import React from 'react';
import type { ComponentStoryFn, ComponentMeta } from '@storybook/react';
import { List } from './List';
import { ListItem } from './ListItem';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'List',
component: List,
} as ComponentMeta<typeof List>;
export const Empty: ComponentStoryFn<typeof List> = (args) => <List {...args} />;
export const OneItem: ComponentStoryFn<typeof List> = (args) => (
<List {...args}>
<ListItem />
</List>
);
export const ManyItems: ComponentStoryFn<typeof List> = (args) => (
<List {...args}>
<ListItem />
<ListItem />
<ListItem />
</List>
);
```