Skip to content

Commit 15dc335

Browse files
authored
docs(AnalyticalTable): add code snippet to "Dynamic Row Count" example (#4781)
1 parent 82860a4 commit 15dc335

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/main/src/components/AnalyticalTable/AnalyticalTable.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,23 @@ By adding the `visibleRowCountMode` prop and setting it to `AnalyticalTableVisib
355355
356356
<Canvas sourceState="none" of={ComponentStories.DynamicRowCount} />
357357
358+
### Code
359+
360+
```jsx
361+
const TableComponent = (props) => {
362+
return (
363+
<div style={{ height: `${props.containerHeight}px` }}>
364+
<AnalyticalTable
365+
data={props.data}
366+
columns={props.columns}
367+
visibleRowCountMode={AnalyticalTableVisibleRowCountMode.Auto}
368+
header={`Current height: ${props.containerHeight}px - Change the height in the table above`}
369+
/>
370+
</div>
371+
);
372+
};
373+
```
374+
358375
## Responsively display columns on small devices (Pop-In)
359376
360377
<ControlsWithNote

0 commit comments

Comments
 (0)