Skip to content

Commit

Permalink
docs(AnalyticalTable): outline initialState more prominently (#6386)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas742 authored Sep 23, 2024
1 parent b196a14 commit 63710d1
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/main/src/components/AnalyticalTable/Recipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,33 @@ const columns = [
];
```

## How to initially set a table state?

To initially select or expand a row; reorder, filter, group, hide or sort a column you can use the `reactTableOptions.initialState` object:

```jsx
<AnalyticalTable
{...otherProps}
reactTableOptions={{
initialState: {
columnOrder: ['age', 'name'],
filters: [{ id: 'age', value: '27' }],
groupBy: ['age'],
hiddenColumns: ['name'],
selectedRowIds: { 2: true, 5: true, ['18.3']: true },
sortBy: [
{
id: 'age',
desc: true
}
],
expanded: {
18: true,
18.3: true
}
}
}}
/>
```

<Footer />

0 comments on commit 63710d1

Please sign in to comment.