storybook/docs/snippets/angular/table-story-fully-customize-controls.mdx.mdx
2021-10-11 23:50:18 +01:00

35 lines
709 B
Plaintext

```md
<!-- Table.stories.mdx -->
import { Meta, Story } from '@storybook/addon-docs';
import { Table } from './table.component';
<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={(args) => ({
props: args,
template: `
<table>
<tbody>
<tr *ngFor="let row of data; let i=index">
<td *ngFor="let col of row; let j=index">
{{data[i][j]}}
</td>
</tr>
</tbody>
</table>
`,
})} />
```