mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
23 lines
525 B
Plaintext
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>
|
|
)} />
|
|
``` |