storybook/docs/snippets/react/table-story-fully-customize-controls.mdx.mdx
2021-11-09 01:41:54 +00:00

26 lines
526 B
Plaintext

```md
<!-- Table.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { Table } from './Table';
import { TD } from './TableDataCell';
import { TR } from './TableRow';
<Meta title="Custom Table" component={Table} />
export const TableStory = ({ data, ...args }) => (
<Table {...args} >
{data.map(row => (<TR>{row.map(item => <TD>{item}</TD>}</TR>))}
</Table>
);
<Story
name="Numeric"
args={{
data: [[1, 2, 3], [4, 5, 6]],
size: 'large',
}}>
{TableStory.bind({})}
</Story>
```