pagination
Tables are paginated by default with row count and page size options for users to choose from.
The default page size options are 10, 20, 50 and 100 rows per page.
Customizing Page Size Options
You can customize the page size options available to users by setting tableOptions.pageSizeOptions, the first option
will be used as the default page size.
<DataTable tableOptions={{ pageSizeOptions: [4, 9, 69, 420] }} />
Disable
If you don't want pagination at all, you can disable it by setting tableOptions.enablePagination to false.
<DataTable tableOptions={{ enablePagination: false }} />
Query Parameters
Current page is pushed to the URL as a query parameter page, so that users can share links to specific pages in a
table. For example, navigating to ?page=3 will open the table on page 3. When on page 1, the page query parameter is
removed from the URL to keep it clean.
Custom Query Parameter Name
You can customize the query parameter name used for pagination by setting tableOptions.queryKeys.page.
Generally we recommend keeping the default page value to ensure consistency across your application and user
familiarity, however if you are using multiple tables on the same page you need to customize the query parameter names
to avoid conflicts.
<DataTable tableOptions={{ queryKeys: { page: 'my-custom-table-page' } }} />
Disable Query Parameters
You can also disable query parameters for pagination by setting tableOptions.queryKeys.page to false.
<DataTable tableOptions={{ queryKeys: { page: false } }} />