storybook/docs/snippets/react/table-story-fully-customize-controls.mdx.mdx
2021-10-12 21:52:15 +01:00

23 lines
525 B
Plaintext

```md
<!-- Table.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { Table } from './Table';
<Meta title="Custom Table" component={Table} />
<!-- Render functions are a framework specific feature to allow you control on how the component renders -->
<Story
name="Numeric"
args={{
data: [[1, 2, 3], [4, 5, 6]],
size: 'large',
}}
render={({ data, ...args }) => (
<Table {...args} >
{data.map(row => (<TR>{row.map(item => <TD>{item}</TD>}</TR>))}
</Table>
)} />
```