Skip to content

Set initial filtering / sorting #10

Answered by KevinVandy
Janekk asked this question in Q&A

You must be logged in to vote

Yes! Check out the initalState prop. You can find all of the state options that you can specify in this table from the docs

https://www.material-react-table.com/docs/api/state-options

You probably want something like this

<MaterialReactTable
  initialState={{
    columnFilters: [{ id: 'lastName', value: "Johnson" }],
    sorting: [{ id: 'firstName', desc: false }],
  }}
/>

Replies: 1 comment 2 replies

You must be logged in to vote
2 replies
@Janekk

@KevinVandy

Answer selected by KevinVandy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants