from reactable import Reactable, embed_css
from reactable.data import cars_93
embed_css()
Pagination
You can change the default page size by configuring default_page_size
:
=4) Reactable(cars_93, default_page_size
You can also set the minimum rows per page using min_rows
. This may be useful when rows don’t completely fill the page, or if the table has filtering:
=4, min_rows=4, searchable=True) Reactable(cars_93, default_page_size
Page size options
You can show a dropdown of page sizes for users to choose from using show_page_size_options
. The page size options can be customized through page_size_options
:
Reactable(
cars_93,=True,
show_page_size_options=[4, 8, 12],
page_size_options=4,
default_page_size )
Alternative pagination types
You can use an alternative pagination type by setting pagination_type
to:
"jump"
to show a page jump"simple"
to show previous/next buttons only
Page jump
Reactable(
cars_93,="jump",
pagination_type=4,
default_page_size )
Simple
Reactable(
cars_93,="simple",
pagination_type=4,
default_page_size )
Hide page info
Reactable(
cars_93,=False,
show_page_info=4,
default_page_size )
Reactable(
cars_93,=False,
show_page_info=True,
show_page_size_options=4,
default_page_size )
Always show pagination
By default, pagination is hidden if the table only has one page. To keep the pagination shown, set show_pagination=True
. This is especially useful if you want to keep the page info showing the number of rows in the table.
Reactable(
cars_93,=True,
show_pagination )
No pagination
Tables are paginated by default, but you can disable pagination by setting pagination=False
:
Reactable(
cars_93,=False,
pagination=True,
highlight=250,
height )
Disabling pagination is not recommended for large tables with many interactive elements (such as links, expand buttons, or selection checkboxes), as that can make it difficult for keyboard users to navigate the page.