from reactable import Reactable, Column, ColFormat
from reactable.data import cars_93
Reactable("manufacturer", "model", "price"]],
cars_93[:, [= {
columns "price": Column(
="Price",
nameformat=ColFormat(prefix="$", digits=2),
),
},=True
filterable )
Reactable
Reactable(self,
data,=None,
columns=None,
column_groups=False,
rownames=None,
group_by=True,
sortable=None,
resizable=None,
filterable=None,
searchable=None,
pagination=None,
default_col_def='asc',
default_sort_order=None,
default_sorted=None,
default_page_size=None,
show_page_size_options=lambda: [10, 25, 50, 100](),
page_size_options='numbers',
pagination_type=None,
show_pagination=None,
show_page_info=None,
min_rows=None,
paginate_sub_rows=None,
details=None,
default_expanded=None,
selection=None,
on_click=False,
highlight=None,
outlined=False,
bordered=False,
borderless=False,
striped=False,
compact=True,
wrap=None,
show_sort_icon=None,
show_sortable=None,
class_=None,
style=None,
row_class=None,
row_style=True,
full_width=None,
width=None,
height=None,
theme=None,
language=None,
meta=None,
element_id=None,
static=None,
dataKey )
A reactive table.
Parameters
Name | Type | Description | Default |
---|---|---|---|
data | dict[str, list[Any]] | DataFrameLike | The data. | required |
columns | list[Column] | None | Named list of column definitions. | None |
column_groups | list[ColGroup] | None | List of column group definitions. | None |
sortable | bool | Whether to enable sorting. Defaults to True . |
True |
resizable | bool | None | Whether to enable column resizing. | None |
filterable | bool | None | Whether to enable column filtering. | None |
searchable | bool | None | Whether to enable global table searching. | None |
pagination | bool | None | Whether to enable pagination. | None |
default_col_def | InitVar[Column | None] | Default column definition used by every column. | None |
default_sort_order | InitVar[Literal['asc', 'desc']] | Default sort order. Either “asc” for ascending order or “desc” for descending order. Defaults to “asc”. | 'asc' |
default_sorted | list[str] | dict[str, str] | None | List of column names to sort by default. Or to customize sort order, a dictionary mapping column names to “asc” or “desc”. | None |
default_page_size | int | None | Default page size for the table. Defaults to 10. | None |
show_page_size_options | bool | None | Whether to show page size options. | None |
pagination_type | Literal['numbers', 'jump', 'simple'] | Pagination control to use. Either “numbers” for page number buttons (the default), “jump” for a page jump, or “simple” to show ‘Previous’ and ‘Next’ buttons only. | 'numbers' |
show_pagination | bool | None | Whether to show pagination. | None |
show_page_info | bool | None | Whether to show page info. | None |
min_rows | int | None | Minimum number of rows to show per page. Defaults to 1. | None |
paginate_sub_rows | bool | None | When rows are grouped, paginate sub rows. Defaults to False . |
None |
details | InitVar[JS | Column | None] | Additional content to display when expanding a row. | None |
default_expanded | bool | None | Whether to expand all rows by default. | None |
selection | Literal['multiple', 'single'] | None | Enable row selection. Either “multiple” or “single” for multiple or single row selection. To customize the selection column, use ".selection" as the column name. |
None |
on_click | Literal['expand', 'select'] | JsFunction | None | Action to take when clicking a cell. Either “expand” to expand the row, “select” to select the row, or a JS function that takes a row info object as an argument. | None |
highlight | bool | Whether to highlight table rows on hover. | False |
outlined | bool | None | Whether to add borders around the table. | None |
bordered | bool | Whether to add borders around the table and every cell. | False |
borderless | bool | Whether to remove inner borders from table. | False |
striped | bool | Whether to add zebra-striping to table rows. | False |
compact | bool | Whether to make tables more compact. | False |
wrap | InitVar[bool] | Whether to enable text wrapping. If True (the default), long text will be wrapped to multiple lines. If False , text will be truncated to fit on one line. |
True |
show_sort_icon | bool | None | Whether to show a sort icon when sorting columns. | None |
show_sortable | bool | None | Whether to show an indicator on sortable columns. | None |
class_ | InitVar[str | list[str] | None] | Additional CSS classes to apply to the table. | None |
style | CssRules | None | Inline styles to apply to the table. | None |
row_class | InitVar[list[str] | Callable[RowIndx, list[str]] | None] | Additional CSS classes to apply to table rows. | None |
row_style | CssRules | Callable[RowIndx, dict[str, str]] | None | Inline styles to apply to table rows. | None |
full_width | InitVar[bool] | Whether to stretch the table to fill the full width of its container. Defaults to True . |
True |
width | int | None | Width of the table in pixels. Defaults to “auto” for automatic sizing. | None |
height | int | None | Height of the table in pixels. Defaults to “auto” for automatic sizing. | None |
theme | Theme | None | Theme options for the table, specified by Theme() . Defaults to the global reactable.theme option. |
None |
language | str | None | Language options for the table, specified by Language() . Defaults to the global reactable.language option. |
None |
meta | dict[str, Any] | None | Custom metadata to pass to JavaScript render functions or style functions. | None |
element_id | str | None | Element ID for the widget | None |