DataTable enables users to act upon complex datasets with a variety of features including filtering and sorting.
The component can be imported via:
When composing with individual components, the following are also available:
DataTableHeader - the header section above the table, where controls like column visibility are placedDataTableHeaderLeftSection - the header section on the left sideDataTableHeaderRightSection - the header section on the right sideDataTableHeaderColumnsMenu - the dropdown menu for column order and visibilityDataTableHeaderSortMenu - the dropdown menu for choosing a sort orderDataTableTable - the actual tableDataTablePagination - the pagination controls, which by default are placed below the table. It will only render its contents when pagination is enabled.The DataTable component is based on the TanStack Table library.
To use the component, at a minimum you'll need to pass in the following props:
caption - an accessible caption for the tabledata - an array of objects representing the rows of the tablecolumns - column configuration, an array of TanStack Table's Column Def objectsA simple example might look like this:
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
Cells can receive custom content, by defining a cell property in the column definition.
Name | Population count |
|---|---|
| Australian Magpie | 5,000 |
| Galah | 7,000 |
| Rainbow lorikeet | 41,234 |
| Golden-shouldered parrot | 123 |
| Tasmanian Emu | 0 |
In React, the cell property can be a function that returns React components:
Name | Conservation status |
|---|---|
| Australian Magpie | Least concern |
| Galah | Least concern |
| Rainbow lorikeet | Least concern |
| Golden-shouldered parrot | Endangered |
| Tasmanian Emu | Extinct |
By default, DataTable will divide the available space equally between all columns.
It's possible to set a column's width by extending the column definition with a meta object,
containing one, or multiple, of the following properties:
width - the desired width of the column. This can be:
123)px, which will be interpreted as a pixel value (e.g., '10px')%, which will be interpreted as a percentage of the table's total width (e.g., '40%')fr, which will behave like the fr grid layout unit - a fraction of the available space (e.g., '2fr')minWidth - a minimum width of the column. This can be a pixel number, a pixel string (e.g., '10px'), or a percentage string (e.g., '20%').
fr values aren't supported.maxWidth - a maximum width of the column. This can be a pixel number, a pixel string (e.g., '10px'), or a percentage string (e.g., '80%').
fr values aren't supported.A column without a defined width acts as if it had a width of 1fr.
Column A (40%, min 200px) | Column B (100 number) | Column C (100px string) | Column D (2fr) | Column E (1fr default) |
|---|---|---|---|---|
| Lorem | ipsum | dolor | sit | amet |
| consectetur | adipiscing | elit | sed | do |
You can control the text alignment of columns by setting the align property in the column definition's meta object.
The property accepts one of the following values:
start - left-aligns text (default)center - centers text horizontallyend - right-aligns text (good for numeric values)Left-aligned (default) | Center-aligned | Right-aligned | Numbers (right) |
|---|---|---|---|
| Left-aligned | Center-aligned | Right-aligned | 12,345 |
| Default is left | This is centered | Right-aligned content | 67,890 |
Cells can be configured to span multiple columns by defining a getCellColSpan function in the column definition's meta object.
The function receives the cell instance and should return the number of columns to span, or undefined for the default behavior (spanning 1 column).
When a cell spans N columns, the next N - 1 cells in that row are hidden.
If a colspan exceeds the number of remaining columns in the row, it is limited to the available space.
Name | Email | Role |
|---|---|---|
| Alice | alice@example.com | Admin |
| Bob | ||
| Charlie | charlie@example.com | Viewer |
Enabling the withColumnsSettings prop will show a dropdown menu, allowing users to
show/hide columns and change their order. Selected (visible) columns are grouped at the top
of the dropdown, with unselected columns below.
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
It is also possible to set the initial order and visibility of columns through the following props:
defaultColumnOrder - an array of column IDs, in the order they should be displayeddefaultColumnVisibility - an object mapping column IDs to booleans, indicating whether the column should be visible or notSpecies | Name |
|---|---|
| tibicen | Australian Magpie |
| roseicapilla | Galah |
| moluccanus | Rainbow lorikeet |
| chrysopterygius | Golden-shouldered parrot |
| novaehollandiae | Tasmanian Emu |
Finally, you can also fully control the column order and visibility states with the following props:
columnOrder - an array of column IDs, in the order they should be displayedonColumnOrderChange - a function that will be called when the column order changescolumnVisibility - an object mapping column IDs to booleans, indicating whether the column should be visible or notonColumnVisibilityChange - a function that will be called when the column visibility changesSpecies | Name |
|---|---|
| tibicen | Australian Magpie |
| roseicapilla | Galah |
| moluccanus | Rainbow lorikeet |
| chrysopterygius | Golden-shouldered parrot |
| novaehollandiae | Tasmanian Emu |
When there are a lot of columns, it can be useful to allow users to search inside
the dropdown for a column by name. A search input can be enabled by the columnsSettings prop
to an object with a withSearch: true property.
The items within the search dropdown render as a virtualized list, to make sure performance doesn't suffer when there are a lot of columns.
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
When there are too many columns to load at once (e.g., a workspace with 300+ attributes), the columns dropdown can load them incrementally as the user scrolls. This is controlled via the columnsSettings prop:
onLoadMore - a callback triggered when the user scrolls near the bottom of the dropdown. Also fires automatically if the initial content is short enough that no scrolling is needed.shouldLoadMore - whether there are more columns available to load. Set to false when all columns have been loaded.isLoadingMore - whether more columns are currently being loaded (shows a spinner at the bottom of the list)Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
When using onLoadMore with server-side data, client-side search won't find columns that haven't been loaded yet. The onSearch callback delegates search to the consumer, who can query a server API and return matching column IDs.
onSearch - called when the user types in the search input. When provided, client-side filtering is disabled and the consumer controls what appears in the dropdown.searchResultColumnIds - an array of column IDs to show in the dropdown. Set to null to show all columns (e.g., when search is cleared). Only the dropdown list is filtered — the table's visible columns are unaffected.isSearching - suppresses the "No columns found" message while a search is in progressThe consumer is responsible for ensuring that columns returned by search exist as column definitions in the table (typically as hidden columns via columnVisibility).
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
DataTable supports two types of pagination:
uncontrolled - the component manages pagination internallycontrolled - the component receives pagination state, and data is expected
to be the current page of data (you control the pagination)To enable uncontrolled pagination, set the withPagination prop to true:
id | foo | bar | baz |
|---|---|---|---|
| 1 | foo 1 | bar 1 | baz 1 |
| 2 | foo 2 | bar 2 | baz 2 |
| 3 | foo 3 | bar 3 | baz 3 |
| 4 | foo 4 | bar 4 | baz 4 |
| 5 | foo 5 | bar 5 | baz 5 |
| 6 | foo 6 | bar 6 | baz 6 |
| 7 | foo 7 | bar 7 | baz 7 |
| 8 | foo 8 | bar 8 | baz 8 |
| 9 | foo 9 | bar 9 | baz 9 |
| 10 | foo 10 | bar 10 | baz 10 |
| 11 | foo 11 | bar 11 | baz 11 |
| 12 | foo 12 | bar 12 | baz 12 |
| 13 | foo 13 | bar 13 | baz 13 |
| 14 | foo 14 | bar 14 | baz 14 |
| 15 | foo 15 | bar 15 | baz 15 |
| 16 | foo 16 | bar 16 | baz 16 |
| 17 | foo 17 | bar 17 | baz 17 |
| 18 | foo 18 | bar 18 | baz 18 |
| 19 | foo 19 | bar 19 | baz 19 |
| 20 | foo 20 | bar 20 | baz 20 |
Additionally, the pagination prop accepts an object with the same properties as the PlumaPagination component.
This allows you to configure the page size, available page sizes, etc.:
id | foo | bar | baz |
|---|---|---|---|
| 1 | foo 1 | bar 1 | baz 1 |
| 2 | foo 2 | bar 2 | baz 2 |
| 3 | foo 3 | bar 3 | baz 3 |
| 4 | foo 4 | bar 4 | baz 4 |
| 5 | foo 5 | bar 5 | baz 5 |
| 6 | foo 6 | bar 6 | baz 6 |
| 7 | foo 7 | bar 7 | baz 7 |
To enable controlled pagination, set the pagination prop to an object with at least one of the following properties:
page - the current page number (1-indexed)onPageChange - a callback function that will be called when the page changeshrefBuilder - a function for building URLs for the pagination buttons, when pagination is navigation-basedAdditionally, you should pass in the same properties as you would for PlumaPagination,
like totalItemCount, so that the component can calculate the number of pages available.
Here's an example that simulates a controlled pagination. In a real app, pagination would usually be performed against an API.
id | foo | bar | baz |
|---|---|---|---|
| 1 | foo 1 | bar 1 | baz 1 |
| 2 | foo 2 | bar 2 | baz 2 |
| 3 | foo 3 | bar 3 | baz 3 |
| 4 | foo 4 | bar 4 | baz 4 |
| 5 | foo 5 | bar 5 | baz 5 |
| 6 | foo 6 | bar 6 | baz 6 |
| 7 | foo 7 | bar 7 | baz 7 |
| 8 | foo 8 | bar 8 | baz 8 |
| 9 | foo 9 | bar 9 | baz 9 |
| 10 | foo 10 | bar 10 | baz 10 |
In some cases, you may want to control the state of the pagination props (the current page etc.), but still have the component perform the actual pagination. For example, you might want to reflect the pagination state in URL query params.
To enable this, set the pagination object as you would in the manual pagination
example, but additionally pass an isManual: false property. This will tell
the table to paginate based on the external props.
Current page: 1
Current page size: 10
id | foo | bar | baz |
|---|---|---|---|
| 1 | foo 1 | bar 1 | baz 1 |
| 2 | foo 2 | bar 2 | baz 2 |
| 3 | foo 3 | bar 3 | baz 3 |
| 4 | foo 4 | bar 4 | baz 4 |
| 5 | foo 5 | bar 5 | baz 5 |
| 6 | foo 6 | bar 6 | baz 6 |
| 7 | foo 7 | bar 7 | baz 7 |
| 8 | foo 8 | bar 8 | baz 8 |
| 9 | foo 9 | bar 9 | baz 9 |
| 10 | foo 10 | bar 10 | baz 10 |
DataTable supports two types of sorting:
uncontrolled - the component manages sorting internallycontrolled - the component receives sorting state, and data is expected
to already be sortedTo enable uncontrolled sorting, set the withSorting prop to true.
Initially, no sorting will be applied, but a column header can be clicked
to sort by that column.
| Australian Magpie | Gymnorhina | 5000 |
| Galah | Eolophus | 7000 |
| Rainbow lorikeet | Trichoglossus | 41234 |
| Golden-shouldered parrot | Psephotellus | 123 |
| Tasmanian Emu | Dromaius | 0 |
An initial sorting column and direction can be set through the sorting prop.
It accepts a configuration object, where value is the current sorting state,
consisting of:
id - the id of the column to sort bydesc - a boolean indicating whether the sorting should be descending or not| Rainbow lorikeet | Trichoglossus | 41234 |
| Galah | Eolophus | 7000 |
| Australian Magpie | Gymnorhina | 5000 |
| Golden-shouldered parrot | Psephotellus | 123 |
| Tasmanian Emu | Dromaius | 0 |
To enable controlled sorting, set the sorting prop to an object with the properties:
value - the current sorting state (with id and desc properties)onChange - a callback function that is called when the sorting state changesTypically, manual sorting might involve calling an API to fetch sorted data.
| Rainbow lorikeet | Trichoglossus | 41234 |
| Galah | Eolophus | 7000 |
| Australian Magpie | Gymnorhina | 5000 |
| Golden-shouldered parrot | Psephotellus | 123 |
| Tasmanian Emu | Dromaius | 0 |
In some cases, you may want to control the state of the sorting props (the current sort column and direction), but still have the component perform the actual sorting. For example, you might want to reflect the sorting state in URL query params.
To enable this, set the sorting object as you would in the manual sorting example,
but additionally pass an isManual: false property. This will tell the table to
sort based on the external props.
Current sorting: population, desc
| Rainbow lorikeet | Trichoglossus | 41234 |
| Galah | Eolophus | 7000 |
| Australian Magpie | Gymnorhina | 5000 |
| Golden-shouldered parrot | Psephotellus | 123 |
| Tasmanian Emu | Dromaius | 0 |
DataTable's column definitions accept the same configuration options as TanStack Table's
columns.
By default, when sorting is enabled, all columns will be sortable. To disable sorting
on specific columns, set enableSorting to false in the column definition:
Genus | ||
|---|---|---|
| Australian Magpie | Gymnorhina | 5000 |
| Galah | Eolophus | 7000 |
| Rainbow lorikeet | Trichoglossus | 41234 |
| Golden-shouldered parrot | Psephotellus | 123 |
| Tasmanian Emu | Dromaius | 0 |
The sort dropdown above the table will display Ascending/Descending or
A-Z/Z-A for the sort direction buttons by inspecting the provided data.
If you would like to explicitly define the text shown in the dropdown, you can
extend the column definitions with a meta object, containing a sortDirectionLabelType property.
It can be set to either:
default - this sets the button labels to Ascending/Descending for this columntext - this sets the button labels to A-Z/Z-A for this column| Australian Magpie | Gymnorhina | 5000 |
| Galah | Eolophus | 7000 |
| Rainbow lorikeet | Trichoglossus | 41234 |
| Golden-shouldered parrot | Psephotellus | 123 |
| Tasmanian Emu | Dromaius | 0 |
DataTable supports rendering nested rows: showing/hiding additional rows with data related to the parent row.
To enable this feature, first, set the withRowExpanding prop to true.
This adds a column at the start of the table, which will contain an expand/collapse button for each row.
Next, define the child rows. By default, DataTable will see if there is a children array property
on the data elements, and use them as data for the child rows. The children elements must have the same
structure as the parent data.
If it's necessary to customize how child rows are retrieved, a getSubRows callback can be passed to
DataTable, which should return an array of child rows.
Name | Genus | Species | |
|---|---|---|---|
| Australian Magpie | Gymnorhina | tibicen | |
| Galah | Eolophus | roseicapilla | |
| Rainbow lorikeet | Trichoglossus | moluccanus |
DataTable also supports expanding rows with custom content, which can be used
to show additional information about a row.
To enable this feature, first, set the withRowExpanding prop to true.
This adds a column at the start of the table, which will contain an expand/collapse button for each row.
Next, define what content should be shown when a row is expanded, by passing an
expandedRowComponent prop to the DataTable. This prop is a component, which will
be rendered by DataTable when a row is expanded. The component will receive a single row
prop, which is a TanStack Table row object.
Name | Genus | Species | |
|---|---|---|---|
| Australian Magpie | Gymnorhina | tibicen | |
| Galah | Eolophus | roseicapilla | |
| Rainbow lorikeet | Trichoglossus | moluccanus | |
| Golden-shouldered parrot | Psephotellus | chrysopterygius | |
| Tasmanian Emu | Dromaius | novaehollandiae |
DataTable supports row selection, allowing users to select one or more rows in
the table via checkboxes.
To enable this feature, set the withRowSelection prop to true.
This adds a column at the start of the table, which will contain a checkbox for each row.
The component will internally keep manage the state of the currently selected rows.
The rowSelection prop accepts an object of row IDs and booleans, allowing you to
control the state instead. Additionally, onRowSelectionChange will be called
whenever the selection state changes, allowing you to update the state accordingly.
Name | Genus | Species | |
|---|---|---|---|
| Australian Magpie | Gymnorhina | tibicen | |
| Galah | Eolophus | roseicapilla | |
| Rainbow lorikeet | Trichoglossus | moluccanus | |
| Golden-shouldered parrot | Psephotellus | chrysopterygius | |
| Tasmanian Emu | Dromaius | novaehollandiae |
By default, when withRowSelection is enabled, all rows will be selectable.
Selection can be disabled for certain rows, and there are two elements to control this:
First, withRowSelection can be a function, which will be called for each row
with the TanStack Table row object
as an argument. The function should return a boolean. If it returns false, the
row won't render a checkbox at all.
Second, a getRowCanSelect callback can also be passed to DataTable. It receives
the same row argument as withRowSelection, and should return a boolean. When
this is false, but withRowSelection is true, the row will render a checkbox,
but in a disabled state.
Essentially, withRowSelection controls whether the row will render a checkbox at all,
while getRowCanSelect controls whether the checkbox will be enabled or disabled.
Name | Genus | Species | |
|---|---|---|---|
| Australian Magpie | Gymnorhina | tibicen | |
| Galah | Eolophus | roseicapilla | |
| Rainbow lorikeet | Trichoglossus | moluccanus | |
| Golden-shouldered parrot | Psephotellus | chrysopterygius | |
| Tasmanian Emu | Dromaius | novaehollandiae |
By default, row selection allows selecting multiple rows at once. To restrict
selection to a single row at a time, set enableMultiRowSelection to false.
This follows the TanStack Table
configuration.
When single row selection is enabled:
enableMultiRowSelection can also be a function, which will be called for each row
to disable multi-row selection conditionally for a row's sub-rows.
Name | Genus | Species | |
|---|---|---|---|
| Australian Magpie | Gymnorhina | tibicen | |
| Galah | Eolophus | roseicapilla | |
| Rainbow lorikeet | Trichoglossus | moluccanus | |
| Golden-shouldered parrot | Psephotellus | chrysopterygius | |
| Tasmanian Emu | Dromaius | novaehollandiae |
When selecting rows, the typical use case is to apply an action to the selected items.
DataTable supports this through the bulkActions prop. It accepts a configuration object with the following properties:
dropdownActions: an array of bulk actions to be rendered in a dropdown menu. The bulk action definitions are objects of the DataTableDropdownBulkAction shapedropdownTrigger: an object with configuration options for the dropdown trigger. Usually you won't need to use this, but it's available to customize the trigger's label or appearance. The shape is DataTableBulkActionDropdownTriggerConfigpromotedActions: an array of actions that will render as buttons in the selection header (instead of inside the dropdown). Think of this as the "primary" bulk actions. The shape of these objects is a little different from the dropdown actions, and is defined via DataTablePromotedBulkAction. Note: it is recommended to keep the number of "promoted" actions low, to avoid showing too many primary choicesThe onClick handlers for bulk actions are called with the following arguments:
selection: the current selection statetable: the instance of Tanstack TableName | Genus | Species | |
|---|---|---|---|
| Australian Magpie | Gymnorhina | tibicen | |
| Galah | Eolophus | roseicapilla | |
| Rainbow lorikeet | Trichoglossus | moluccanus | |
| Golden-shouldered parrot | Psephotellus | chrysopterygius | |
| Tasmanian Emu | Dromaius | novaehollandiae |
DataTable supports row actions: actions that can be performed on an individual row,
by rendering a dropdown menu with options in each row.
This is controlled via the rowActions prop. It accepts a configuration object
with the following properties:
dropdownActions - an array of actions or groups of actions to be rendered in
the dropdown menu. They can either be:
label - the label of the group. This is optional - if not provided, a label-less
group will be rendered (which can be useful for rendering sections of actions
separated by a line)actions - an array of action items to be rendered within this groupDataTableRowActionItem shapedropdownMenu - optionally, additional configuration for the DropdownMenu componentdropdownTrigger - optionally, additional configuration for the dropdown menu's button triggerAlternatively, rowActions can also be a function, which will be called with the
Row instance as an argument,
and is expected to return the configuration object as described above. This allows
creating dynamic row actions, or disabling actions for certain rows.
Name | Genus | Species | |
|---|---|---|---|
| Australian Magpie | Gymnorhina | tibicen | |
| Galah | Eolophus | roseicapilla | |
| Rainbow lorikeet | Trichoglossus | moluccanus | |
| Golden-shouldered parrot | Psephotellus | chrysopterygius | |
| Tasmanian Emu | Dromaius | novaehollandiae |
DataTable supports searching the table contents with a search input. This can be
enabled by enabling the withSearch prop.
Two types of search are supported:
uncontrolled - the component manages search internallycontrolled - the component receives search state, and data is expected to already be filtered accordinglyAdditional search configuration can be passed in via the search prop. For example,
globalFilterFn can be used to configure how TanStack Table should filter the contents.
The search prop also accepts most of the PlumaSearch component's options.
This allows you to configure when the search should be triggered (on each key input, on enter, etc.),
what the aria-label, placeholder, should be, and more.
Uncontrolled search will use TanStack Table's
global filtering feature.
By default, all columns are searched, but this can be disabled on individual
columns by setting their enableGlobalFilter key to false.
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
Controlled search is when the search state is managed by the invoker of the component.
To enable it, the search configuration prop should include the following keys:
value - the current value of the search inputonSearchInput - a callback when the value of the search input changesonSearch - called when the search should be triggered (depending on settings such as shouldSearchOnEnter etc.)Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
In some cases, you may want to control the state of the search props (the current search value), but still have the component perform the actual search. For example, you might want to reflect the search state in URL query params.
To enable this, set the search object as you would in the manual search example,
but additionally pass an isManual: false property. This will tell the table to
search based on the external props.
Note: the value passed into the component is the value that'll instantly
apply for filtering, regardless of the shouldSearch setting. Internally, the
component maintains separate state for the value of the search input, versus
the value that's currently applied for filtering. In this mode, make sure
to only update the value state in the onSearch callback. If you wish to
also know what the current search input value is, you can use the onSearchInput
callback.
Current search value:
Current search input value:
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
By default, when search is controlled, the value prop drives both the search
input's displayed text and the filter applied to the table. This means the table
rerenders on every keystroke, which can be slow for large datasets.
The inputValue prop allows decoupling the input's display value from the
filter value. When provided:
inputValue controls what the search input displaysvalue controls the filter applied to the tableThis way, the table only rerenders when value changes (e.g. on submit),
while the input remains responsive as the user types.
Current search value:
Current input value:
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
In addition to text-input-based search, DataTable also supports filtering the
table contents with the Filters component. Due to the
flexibility the Filters component provides, this filtering is always "controlled":
it is up to you to implement the filtering logic (typically through an API), and
pass in the filtered data.
To enable filtering, set withFilters to true. Additionally, the filters prop
expects the same props as the Filters component itself.
This will render a Filters button in the header section of the table, with the
filter selection dropdown. When filters are added, a section is added below the header,
with the entire Filters component embedded.
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
When the table has no data to show (either the data prop is empty, or the result
of search or filters returns empty results), the table will show an empty state.
This behavior can be disabled by setting the withEmptyState prop to false.
The empty state can be customized by passing a emptyState prop, which is an object with the following properties:
title - The title of the empty stateicon - The icon to show above the titledescription - The description of the empty stateactions - An array of buttons to show in the empty state. The shape of these
objects is the same as the Button component's props.The table will render the EmptyState component with the
provided configuration.
Name | Genus | Species |
|---|---|---|
No matching results foundTry adjusting your search or filters. | ||
If the empty state configuration object isn't enough to suit your use case, you
can pass a custom component to the emptyStateComponent prop, which will be
rendered in place of the default. This component will be called with a table
prop, which is the table instance.
Name | Genus | Species |
|---|---|---|
Custom empty state | ||
While data is loading, the table can show a loading state via the isLoading prop.
When the current data is empty, the table will show a default number of
placeholder rows with SkeletonText components.
A loading spinner will also be shown in the header section, if it's visible
(when settings such as column visibility or order are enabled).
Name | Genus | Species |
|---|---|---|
If there is data, the table will show a number of placeholders equal to how many data rows would currently be visible.
Name | Genus | Species |
|---|---|---|
The number of placeholder rows can be customized via the loadingState prop.
It accepts an object, where the rowCount property is the number of placeholder
rows you'd like to show.
Name | Genus | Species |
|---|---|---|
It is also possible to override the placeholder content for each column's cells.
This can be done by adding a meta property to the column definition, with a
loadingPlaceholder property which is a function that follows the same
rules as the standard cell rendering definitions.
The function will be called with an object argument containing the following properties:
table - the instance of the tablecolumn - the current columnrowIndex - the index of this placeholder rowName | Genus | Species |
|---|---|---|
| Placeholder 0 | ||
| Placeholder 1 | ||
| Placeholder 2 |
When there is more data to load, the table can be configure to show a "Load more" row, which - when clicked - will trigger a callback to load more data. Such a row can be inserted at the start and/or end of the table.
Typically, you might insert a "load more" row at the top when there is new data to be loaded. You would place one at the bottom when there are more pages to be loaded - like in continuation-based paging - or when there's more "older" data.
The props are loadNew and loadMore respectively, and they accept an object
of the shape:
canLoad - a boolean indicating whether there is more data to load -
this controls whether the row is shownonClick - a callback triggered when the row is clicked. If this returns a
promise, the button will switch to a loading state while the promise is pendingisLoading - a boolean to control the loading state of the button (if the
onClick promise isn't appropriate)label - (optional) the text to display in the buttonOnce new data is loaded, it's up to the developer to update the passed in data state accordingly.
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
The table supports saved views, which are a way to save and share table configurations, or provide preset filters.
To enable this functionality, you must enable the withSavedViews prop. Additionally,
a savedViews prop must be provided, which is a configuration object for the feature.
At the very least, the following properties should be provided:
views - an array of view objects to show
id string property, and a name string propertyactiveViewId - the id of the currently active viewonActiveViewChange - a callback that is called when the active view changes (when the user clicks on a view)The DataTable component doesn't handle any state management for saved views,
it is up to the consumer to manage active view state, any filters or search queries it
might include, and the saving/editing/retrieving of views.
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
For convenience, a view object may include a meta property, which is an object
that can be used to store any type of additional data.
This can, for example, be used to store filter values for each view, allowing views to apply any filter state.
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
To enable creating new views, and/or editing/deleting existing ones, the savedViews
config accepts the following properties:
onSave - a callback that is called when a new view is savedonEdit - a callback that is called when an existing view is editedonDelete - a callback that is called when an existing view is deletedThe callbacks will be called with the following arguments:
canCreateView - a boolean indicating whether the user can create new viewsonCreateView - a callback that is called when a new view is created
name - the name of the new viewtable - the instance of the tablecolumnOrder - the current state of the column ordercolumnVisibility - the current state of the column visibility settingssearchValue - the current search value (if any)filters - the current filter values (if any)canEditView - a boolean indicating whether the user can edit existing viewsonEditView - a callback that is called when an existing view is edited
onCreateView,
plus an id property - the id of the edited viewid, name, and table properties
are passed to the callbackcanDeleteView - a boolean indicating whether the user can delete existing viewsonDeleteView - a callback that is called when an existing view is deleted
id of the view to be deletedAdditionally, for more fine-grained control, each individual view object may also
include the following properties:
canEdit - a boolean indicating whether the user can edit this viewcanDelete - a boolean indicating whether the user can delete this viewIt is up to the developer to implement the logic for saving and deleting views.
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
DataTable supports rendering "virtualized" table rows, where only a subset
of rows is actually rendered at a time (only as much as is visible in the viewport).
This can be used to render very large tables without performance issues, when
pagination is not desired.
For virtualization we use the TanStack Virtual library (both in Ember and React).
To enable it, set the withVirtualizer prop to true
Optionally, the virtualizerOptions argument accepts the same options as the library's
Virtualizer class,
allowing you to customize the behavior if necessary.
DataTable will attempt to find the nearest scrollable parent container, but
it is recommended to pass in a getScrollElement
function to ensure the virtualizer references the correct container.
Additionally, it may be necessary to pass in an estimateSize
function to allow the virtualizer to better estimate the size of the rows, and
the total height.
id | foo | bar | baz |
|---|---|---|---|
By default, DataTable is used by invoking the one component and passing configuration props.
The table is styled to render in a Panel component.
In some use cases you may want to render the table without the Panel styling, or perhaps insert additional components into the various header sections.
The DataTable component, and the individual header row and section components,
behave in the following way:
children content), they render theri default contentschildren content is present, no defaults are rendered to allow for customization/compositionThe default layout of the table is as follows:
DataTableHeaderRow
wrapper component, which is a PanelSection and ensures consistent padding and borders.
The sections of the header are:
DataTableHeaderSavedViews section, containing:
DataTableHeaderSavedViewsLeftSection:
DataTableHeaderSavedViewsListDataTableHeaderSavedViewsRightSection:
DataTableHeaderActions section, containing:
DataTableHeaderActionsLeftSection:
DataTableHeaderSearchInput (if search is enabled)DataTableHeaderFiltersButton (if filters are enabled)DataTableHeaderActionsRightSection:
PlumaSpinner, is isLoading is trueDataTableHeaderSortMenu (if sorting is enabled)DataTableHeaderColumnMenu (if column settings are enabled)DataTableHeaderFilters section, containing:
DataTableHeaderFiltersLeftSection:
DataTableHeaderFiltersList (which wraps a Filters component)DataTableHeaderFiltersRightSection:
DataTableHeaderSaveViewButton (if saved views are enabled)PanelInset)DataTablePagination, rendered outside of the panel, if pagination is enabledThe most simple use case would be to render the table without the Panel styling, which would look like this:
Name | Genus | Species |
|---|---|---|
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
You may want to customize the header sections of the table, for example to add a custom control next to the existing action controls (like the column ordering and sorting dropdowns).
DataTableHeader yields an object with the following properties:
shouldShowSavedViews - a boolean indicating whether the saved views section should be shown.
It's based on whether saved views is enabled, and whether there are any saved views to show.shouldShowActions - a boolean indicating whether the actions section should be shown (based on
whether search, filters, sorting, or column settings are enabled)shouldShowFilters - a boolean indicating whether the filters section should be shown| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
If you would like to keep the Panel styling while composing, surround the table contents
(except for pagination, which is meant to live outside of the panel), with a Panel component.
DataTableHeader should not be wrapped in a PanelSection or PanelInset component,
as it doesn't render any surrounding tags itself. The header sections, however,
should be wrapped in a DataTableHeaderRow component, if you want to reuse the
DataTable's default section paddings and borders.
DataTableTable should be placed in a PanelInset component, so that it renders
from edge to edge of the Panel.
| Australian Magpie | Gymnorhina | tibicen |
| Galah | Eolophus | roseicapilla |
| Rainbow lorikeet | Trichoglossus | moluccanus |
| Golden-shouldered parrot | Psephotellus | chrysopterygius |
| Tasmanian Emu | Dromaius | novaehollandiae |
PlumaDataTable extends BoxBulk actions to show when at least one row is selected.
dropdownActions will be shown in a dropdown menu.
dropdownTrigger is a configuration object for the dropdown trigger button.
promotedActions are action buttons that render in the header, next to the dropdown if there is one.
A caption for the table for assistive technologies, but hidden visually.
The column order, when you want to control it externally.
Column definitions. See TanStack Table docs for more details.
Additional configuration for the column settings dropdown.
The column visibility, when you want to control it externally.
The data to render in the table.
The initial order of columns, as an array of column IDs.
Ignored when columnOrder is set.
The initial visibility of columns, where the keys are column IDs.
Ignored when columnVisibility is set.
A configuration object for the empty state.
A custom component to render for the empty state, instead of the
default one configured in emptyState.
It receives a table prop, which is the current instance of TanStack Table.
Default:true
Whether to allow selecting multiple rows, or only one row at a time. If the value is a boolean, it applies to the whole table. If a function is provided, it can be used to control whether multiple selection is allowed for a row's children. https://tanstack.com/table/latest/docs/guide/row-selection#single-row-selection
A custom component to render when a row is expanded. This is different from rendering sub-rows: the custom component can render anything, while "nested rows" are more rows of the same type.
A configuration object for filters.
These extend from the PlumaFilters component.
A function to determine whether a row can be expanded. By default, a row can be expanded either when:
expandedRowComponent, which will be rendered as the expansionWhether to enable selection on individual rows.
When withRowSelection is true, this argument can be used
to disable selection for all or specific rows.
If this is a boolean of false, all rows render a disabled checkbox.
If it's a function that returns false, the false rows will render a disabled checkbox
A function to get the ID of a row. By default, id will be used - if present.
Otherwise, the row's index will be used.
A function to determine a row's sub-rows (nested rows of the same type).
By default, we check whether a row has a children array property and use that.
Override this if you'd like to determine nested rows differently.
An object to control the initial expanded state of rows, where the keys are row IDs.
Whether to disable the border style between table rows
Whether data is currently being loaded, making the table show a loading state.
Whether to render table rows with alternating background colors
Default:auto
The layout of the table
Additional configuration for the loading state.
Configuration for the "Load more" row, shown at the bottom of the table. For example, when there is more data to load that should be appended to the current data.
Configuration for the "Load new" row, shown at the top of the table. For example, when there is new data available to load.
A callback for when the column order changes.
A callback for when the column visibility changes.
Callback for when the row selection changes.
Callback for when the sorting state changes.
A configuration object for pagination within the table.
When withPagination is enabled and no configuration is provided,
the table will perform pagination internally with
default settings, based on the provided data.
When an object is provided without the page property, the
table will also perform pagination internally, but with the provided
settings.
When page is provided, the table assumes pagination is
controlled externally, and data is already paginated.
Configuration object for row actions.
dropdownActions are the actions shown within the dropdown menu.
dropdownMenu can contain additional configuration for the DropdownMenu component.
dropdownTrigger can contain additional configuration for the dropdown menu's trigger button.
This can also be a function that receives the current Row instance, and returns the configuration object, all (which allows for dynamic actions, customizing them per row).
Row selection state object, where the keys are row IDs.
Configuration for the saved views feature.
A configuration object for the search input.
These are the same props as in the PlumaSearch component.
Whether hovering over the rows should highlight them (change their background color)
A configuration object for sorting.
The { id, desc } object form is deprecated, please use
the { value: { id, desc }, onChange } form instead.
Options, or a function that returns options, for the Virtualizer.
Default:false
Whether to show the Columns button for controlling column order and visibility.
Default:true
Whether to enable showing the empty state when data is empty.
Default:false
Whether to enable filters.
Whether to enable pagination.
Whether to enable row expansion. This will add an "expander" column to the left of the table, and allow expanding expandable rows.
Default:false
Whether to enable row selecting.
This will add a column at the start of the table to render selection
checkboxes in.
Can be a boolean to enable selection for all rows, or a function to
conditionally enable selection for certain rows.
When this returns false for a row, the row won't render a checkbox at all.
Default:false
Whether to enable the saved views feature.
Default:false
Whether to enable searching via a search input.
Default:false
Whether to enable sorting rows. If no sorting state is provided, the table will sort the rows internally.
Whether the table rows should render virtualized.
Whether more columns are currently being loaded.
Whether a server-side search is currently in progress. When true, the dropdown shows a loading indicator instead of "No columns found".
Callback for when the end of the columns list is reached and more columns should be loaded.
Callback for server-side search. When provided, the component delegates
search to the consumer instead of filtering columns client-side.
The consumer should set searchResultColumnIds with the matching column IDs.
Column IDs to show in the dropdown when using server-side search. Only these columns appear in the dropdown list. The table's columns are unaffected. Set to null/undefined to show all columns (e.g. when search is cleared).
Whether the onLoadMore callback should be called when the end of the list is reached. If no more columns are available, this should be set to false.
Whether to show a search input for filtering columns within the dropdown.
If provided, the component will render as a link instead
The name of an icon (from Pluma Icons) to render in the button
Default:leading
Which side of the text the icon should be rendered on. leading renders the icon before the text, trailing renders it after
Whether the button should be rendered in an danger state
Disables the button. Use this instead of the native disabled prop, to make sure non-button elements (when used with as) get the correct styles
When this flag is true, an a tag will be used instead of the provider's linkComponent, even if it exists.
Additionally, target="_blank" rel="noopener noreferrer" will be added automatically
When this is set to true, the button won't render any text, and will reduce its side paddings
The text to show in the button.
Function called when the action is selected. The arguments are the current selection state, and the table instance.
This is passed into the provider's linkComponent.
It can be used by the link component implementation to handle replaceState instead of pushState
Default:md
The size of the button.
medium and small are deprecated, use md and sm instead.
Optional tooltip text to display when hovering over the button
Default:secondary
The visual style variant of the button.
This allows turning off the automatic addition of target="_blank" rel="noopener noreferrer".
This can be used for links to other protocols like mailto:
Optional description text to display below the menu item
The URL for the link, if the item should render as a link instead of a button
Optional icon to display alongside the menu item text
Whether the item should be displayed with critical/danger styling
Whether the item is disabled
Whether the link is external. When this flag is true, an a tag will be used,
and target="_blank" rel="noopener noreferrer" will be added automatically
Whether this item is also a trigger for another sub-menu.
The text to show in the menu item.
Function called when the item is clicked. The arguments are the current selection state, and the table instance.
This is passed into the provider's linkComponent when used with href.
It can be used by the link component implementation to handle replaceState instead of pushState
Default:true
Whether clicking the item should close the popover
Optional tooltip text to display when hovering over the menu item
Optional icon to display on the trailing side of the menu item. Typically used for a sub-menu trigger indicator (e.g. a right chevron).
Default:true
Whether to add safe external attributes (target="_blank" rel="noopener noreferrer")
for external links. This can be turned off for special cases like mailto: links
The name of an icon (from Pluma Icons) to render in the button
Default:leading
Which side of the text the icon should be rendered on. leading renders the icon before the text, trailing renders it after
Disables the button. Use this instead of the native disabled prop, to make sure non-button elements (when used with as) get the correct styles
When this is set to true, the button won't render any text, and will reduce its side paddings
Shows a spinner in the button overlaid on top of the button's content. The button will act as if disabled while in the loading state.
Default:"Actions"
The label to show in the dropdown trigger.
Default:md
The size of the button.
medium and small are deprecated, use md and sm instead.
Optional tooltip text to display when hovering over the button
Default:secondary
The visual style variant of the button.
Actions to show in a dropdown menu for each row. Can be a static array of actions, or a function that receives the current row and returns an array of actions (allowing for dynamic actions, customizing them per row). The array items can either be groups of actions (with optional labels), or plain actions.
Additional configuration options for the DropdownMenu component.
Additional configuration options for the dropdown menu's trigger button.
The actions to show in this group.
An option label for the group. If not provided, the group won't render a header, but will still render a divider to separate action items from other groups.
Optional description text to display below the menu item
The URL for the link, if the item should render as a link instead of a button
Optional icon to display alongside the menu item text
Whether the item should be displayed with critical/danger styling
Whether the item is disabled
Whether the link is external. When this flag is true, an a tag will be used,
and target="_blank" rel="noopener noreferrer" will be added automatically
Whether this item is also a trigger for another sub-menu.
The text to show in the menu item.
Function called when the item is clicked. Receives the row instance in which the action was clicked as an argument.
This is passed into the provider's linkComponent when used with href.
It can be used by the link component implementation to handle replaceState instead of pushState
Default:true
Whether clicking the item should close the popover
Optional tooltip text to display when hovering over the menu item
Optional icon to display on the trailing side of the menu item. Typically used for a sub-menu trigger indicator (e.g. a right chevron).
Default:true
Whether to add safe external attributes (target="_blank" rel="noopener noreferrer")
for external links. This can be turned off for special cases like mailto: links
Whether sorting is controlled externally.
By default, when withSorting is enabled and sorting is
provided, DataTable assumes that the consumer controls sorting
the data as well.
Setting isSortingManual to false allows only controlling the sorting prop,
while still letting the table handle sorting internally.
Callback for when the sorting state changes.
The current sorting state, when sorting is done externally (e.g. via an API).
If onChange isn't provided, this will be the initial sorting state,
and the table will perform sorting internally.
This is an object with the following properties:
id - a column IDdesc - a boolean indicating whether the column is sorted in descending order(Optional) The number of items on the current page.
When the total number of items is unknown (totalItemCount is -1), this
count will be used to display the count of items on the current page.
If provided, this function will be used to generate links for the
page navigation buttons. The buttons will be rendered as a tags,
and the strings returned by this function will be used as the href attribute.
If page is not provided to the component (continuation-based paging), the
first argument will be -1.
Whether the current page is the first page. Useful in continuation-based paging where the current page number is unknown.
Whether the current page is the last page. Useful in continuation-based paging where the current page number is unknown.
Whether the pagination is controlled externally.
By default, when page, onPageChange, or hrefBuilder are
provided, DataTable assumes that the consumer controls paginating
the data as well.
Setting isManual to false allows only controlling the page prop,
while still letting the table handle pagination internally.
Called when a navigation button is clicked, with the new page number (if available), and the control that was clicked.
If page is not provided to the component (continuation-based paging), the
first argument will be -1.
When pagination is changed programmatically (not through a button click),
the control argument will be custom.
Called when the page size is changed, with the new page size.
The current page number.
Default:20
The size of the page (how many items per page).
This, along with totalItemCount, is used to calculate the total number of pages.
Default:[10, 20, 50, 100]
The page sizes to display in the page size selector.
The total number of items (if known).
This, along with pageSize, is used to calculate the total number of pages.
If a total is unknown, provide -1 to have the component reflect that in the page count.
Element (or elements) that describe the form field. Also used for error messages, as aria-errormessage isn't supported in all assistive technologies: https://a11ysupport.io/tech/aria/aria-errormessage_attribute
String value that labels the form field.
Element (or elements) that label the form field.
Additional classes to be applied to the top-level container. This is necessary as an argument in Ember, where we apply splattributes on the "input" itself, which means we can't pass a custom class to the containing element the classic way.
Default:true
Whether the search input is immediately visible by default.
When false, we will first show a button, which reveals the
search input when clicked.
A description for the field, providing additional context or hints.
An error message associated with the form field.
Boolean: Ember-only. If the error named block is used,
this prop can be set to true to indicate an error is present,
which will make the error block render.
A custom filter function to use for uncontrolled search. See TanStack Table docs for more details.
The name of an icon (from Pluma Icons) to be rendered on the left side of the input.
An optional id to be assigned to the input element. Also used to generate ids for labels and error messages. If one isn't provided, it will be generated.
When provided, this controls the search value for the search input,
separately from the value prop, which will then be used for filtering.
This allows decoupling the input state from the actual search value,
which can improve DataTable performance when typing in the input
(otherwise, the table might rerender on every keystroke).
Whether the input should render in an "active" styled state.
Whether the form field is disabled.
Whether the form field is in an invalid state.
Whether the input should show a loading spinner.
Whether filtering via the search input is controlled externally.
By default, when value and onSearch or onSearchInput are
provided, DataTable assumes that the consumer controls filtering
the data as well.
Setting isManual to false allows only controlling the value prop,
while still letting the table handle filtering internally.
The label text to show with the form field.
The name attribute is used for HTML forms
The blur event handler for the input element.
The change event handler for the input element.
Called when the clear button is clicked.
The focus event handler for the input element.
The input event handler for the input element.
The function called when the search should be done
Any changes to the value for the search input
Placeholder text to show inside the field.
Whether to allow browser autofill and password managers. When false (default), adds attributes to disable password managers (1Password, LastPass, Bitwarden, Dashlane). Set to true for fields where autofill is desired (e.g., email, password, address fields).
Whether the generated description id should be included in the input's aria-describedby attribute.
Disable this when a label`` tag surrounds the input as well as it's description text, for example in an OptionCard` component.
Whether the generated label id should be included in the input's aria-labelledby attribute.
Disable this when the label tag surrounds the input as well as it's label text,
for example in an OptionCard component.
Whether to search when the search input is blurred.
Whether to search when the clear button is pressed.
Whether to search on a specific debounced interval, must be greater than 0 to trigger a search.
Whether to search when Enter is pressed.
Whether to search when the value changes.
By default, form elements will throw an error if no label or aria-label is provided. Disable this to suppress the error, for example when building a custom form element, and you want to handle labeling yourself.
The size of the input element.
The type of input that should be rendered. Defaults to text.
Pluma internal property to set a component name used for logging. Only use if building a custom component that wraps this one and need to make it more obvious where errors, for example, come from.
Additional classes to be applied to the description element.
Additional classes to be applied to the error element.
Additional classes to be applied to the field node.
Ember-only: this is used internally to detect whether a label
named block is present, and to ignore empty label props if so.
Additional classes to be applied to the input node.
Sets the size attribute on the input element. This controls the visible width of the input in characters.
Additional classes to be applied to the div that wraps the input element.
Whether the component should render with "legacy" styles.
Additional classes to be applied to the label node.
The current value.
Whether to apply the center-baseline variant.
Ember only: a modifier to apply on the input's wrapper element.
React only: a ref to the input's wrapper element.
The button variant of the "add filter" component.
Whether the "add button" dropdown should render in an open state by default.
The filters which will be displayed
Whether the filters are disabled
Called when a filter value changes
Clears a filter
Clears all filters
Called when a filter is selected within the dropdown
The values of the filters
Action button to show in the EmptyState.
The description of the EmptyState.
The icon to show above the title.
The title of the EmptyState.
How many placeholder rows to show while loading.
The id of the currently active saved view, if any.
Whether creating new views is allowed.
Whether deleting views is allowed.
Whether editing views is allowed.
Default:"Default"
The name of the "default" view.
Called when the active view changes (usually by clicking a saved view button).
Called when a new view is saved. The function is called with an object containing the new view's label, and the current state of the table.
Called when an existing view is deleted.
Called when an existing view is edited (renamed, or its filters updated, etc.).
An array of saved views to show in the table header.
Whether deleting this view is allowed.
Whether editing this view is allowed.
A link to navigate to when the saved view is clicked.
Can be used instead of onClick, which will make the component
render a link, triggering navigation events. Can be used
when saved views are driven by query parameters.
A unique identifier for the saved view.
Whether this view is currently disabled.
Any custom data to keep in the view object.
The text to show in the saved view button.
A click handler for when the saved view is clicked.
Called when changes are saved to this view.
Optional tooltip text to display when hovering over the button.
Whether more data is available to load, which shows the row.
Whether more data is currently being loaded, which puts the row into a loading state.
Optionally overrides the default label shown within the row.
Callback for when the load more row button is clicked.
The accessor function to use when extracting the value for the column from each row. See TanStack for details
The key of the row object to use when extracting the value for the column. See TanStack for details
The cell to display for each column. See TanStack for details
The header to display for each column. See TanStack for details
An id for the column. See TanStack for details
Additional metadata/configuration for the column.
The alignment of the column
Default:'middle'
The vertical alignment of the column's body cells.
A function that returns a custom colspan for a cell, which can be used
to make cells that span multiple columns.
When a cell spans multiple columns, the next N cells will be hidden, where N is the colspan - 1.
A component to use for this column's cells when the table is
in the loading state.
This follows the same rules as defining cell or header
renderers for the column.
The maximum possible width for the column.
Can be a number (pixels), a % string, or a px string.
The minimum possible width for the column.
Can be a number (pixels), a % string, or a px string.
The name of a column. Used as a fallback for column headers when the
header property isn't a string, and when you don't want the column's
id to be the visible name.
Default:false
Whether cell content should wrap when it overflows the cell. By default, cell content will be truncated with an ellipsis.
This setting determines what the Sort dropdown shows
for the ascending/descending sort options.
Depending on data type, the buttons will say either:
Ascending and DescendingA-Z and Z-A
The table will try and guess the best option depending on
the data provided, but this setting allows explicit control.The options are:
default for Ascending and Descendingtext for A-Z and Z-AThe width of a column.
%, it will be interpreted as a percentage of the table width.fr, it will act like a fraction unit, similar to a grid layout.px, it will be interpreted as a pixel value.