| activePage | - | number |
The controlled active page. Pair it with onActivePageChange; for the uncontrolled mode use defaultActivePage instead. Only applicable when pagination prop is enabled. |
| ariaCleanerLabel6.0.0+ | Clear filters and sorting | string |
A string that provides an accessible label for the cleaner button. This label is read by screen readers to describe the action associated with the button. |
| ariaSelectAllLabel6.0.0+ | Select all rows | string |
A string that provides an accessible label for the checkbox that selects every row. This label is read by screen readers to describe the action associated with the checkbox. |
| ariaSelectRowLabel6.0.0+ | Select row | string |
A string that provides an accessible label for the checkbox that selects a single row. This label is read by screen readers to describe the action associated with the checkbox. |
| cleaner | - | boolean |
When set, displays a button above the table that resets globalFilterValue, columnFilterValue and sorterValue, next to the global filter. The button is disabled when there is nothing to reset. |
| cleanerIcon6.0.0+ | (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 512 512"
fill="currentColor"
>
<path d="M40 16v37.828L109.024 136h41.791L76.896 48H459.51L304 242.388v158.985L241.373 464H240v-96h-32v128h46.627L336 414.627V253.612l160-200V16z" />
<path d="m166.403 248.225 60.461-60.462-22.627-22.628-60.462 60.462-60.462-60.462-22.626 22.628 60.461 60.462-60.461 60.462 22.626 22.627 60.462-60.462 60.462 60.462 22.627-22.627z" />
</svg>
) | ReactNode |
The icon of the cleaner button. |
| clickableRows | - | boolean |
Style table items as clickable. |
| columnFilter | - | boolean, ColumnFilter |
When set, displays additional filter row between table header and items, allowing filtering by specific column. Column filter can be customized, by passing prop as object with additional options as keys. Available options: - lazy (Boolean) - Set to true to trigger filter updates only on change event. |
| columnFilterValue | - | ColumnFilterValue |
The controlled column filter values. Pair it with onColumnFilterChange; for the uncontrolled mode use defaultColumnFilterValue instead. To set pass object where keys are column names and values are filter strings e.g.: { user: 'John', age: 12 } |
| columns | - | (string | Column | ColumnGroup)[] |
Table columns configuration. When omitted, the columns are generated from the keys of the first item, skipping the keys that begin with an underscore. Each array item is either a column name, a column object or a group of columns: - key (required)(String) - the name of the item property the column displays. - label (String) - the visible label of the column. When omitted, it is generated from key by splitting kebab-case and snake_case into words and capitalizing each of them. - sortable (Boolean) - set to false to exclude the column from sorting. - sorter (Function) - a custom comparator for the column, called with two items. - filterable (Boolean) - set to false to remove the filter from the column. - filter (Function) - a custom filter for the column, called with the column values, a change handler and the current filter state. - headerStyle (Object) - inline styles for the column header (useful for defining widths). - headerProps (Object) - properties for the column header cell. - cellStyle (Object) - inline styles for every data cell in the column. - cellProps (Object) - properties for every data cell in the column. - children (Array) - columns grouped under one header; a group carries label and children only. |
| columnSorter | - | boolean, Sorter |
Enables table sorting by column value. Sorting will be performed corectly only if values in column are of one type: string (case insensitive) or number. Sorter can be customized, by passing prop as object with additional options as keys. Available options: - multiple (Boolean) - Enables sorting by multiple columns simultaneously. The sorting order will be maintained across multiple columns based on the order of interaction. - resettable (Boolean) - If set to true, clicking on the sorter cycles through three states: ascending, descending, and null (no sorting). The third click on the sorter will reset the sorting and restore the table to its original order. |
| defaultActivePage6.0.0+ | - | number |
The initial active page for the uncontrolled mode. Ignored when activePage is set. |
| defaultColumnFilterValue6.0.0+ | - | ColumnFilterValue |
The initial column filter values for the uncontrolled mode. Ignored when columnFilterValue is set. |
| defaultGlobalFilterValue6.0.0+ | - | string |
The initial global filter value for the uncontrolled mode. Ignored when globalFilterValue is set. |
| defaultItemsPerPage6.0.0+ | - | number |
The initial number of items per page for the uncontrolled mode. Ignored when itemsPerPage is set. |
| defaultSelected6.0.0+ | - | Item[] |
The initial selected items for the uncontrolled mode. Ignored when selected is set. |
| defaultSorterValue6.0.0+ | - | SorterValue[] |
The initial sorter state for the uncontrolled mode. Ignored when sorterValue is set. |
| external6.0.0+ | - | boolean |
The items are already filtered, sorted and sliced by the data source, so the table renders them as they are and only reports the requested state through the callbacks. Use totalItems to let it compute the number of pages. |
If true Displays table footer, which mirrors table header. (without column filter). Or Array of objects or strings, where each element represents one cell in the table footer. Example items: ['FooterCell', 'FooterCell', 'FooterCell'] or [{ label: 'FooterCell', props: { theme: 'success' }, ...] |
| globalFilter6.0.0+ | - | boolean, GlobalFilter |
When set, displays a filter input above the table that filters the items by the values of all columns. The global filter can be customized, by passing prop as object with additional options as keys. Available options: - lazy (Boolean) - Set to true to trigger filter updates only on change event. |
| globalFilterLabel6.0.0+ | Filter: | string |
The element represents a caption for the global filter input. |
| globalFilterPlaceholder6.0.0+ | type string... | string |
Specifies a short hint that is visible in the global filter input. |
| globalFilterValue6.0.0+ | - | string |
The controlled value of the global filter. Pair it with onGlobalFilterChange; for the uncontrolled mode use defaultGlobalFilterValue instead. |
Set to false to remove table header. |
| itemKey6.0.0+ | - | string |
The name of the item property that identifies a row. When set, selection and row keys compare that value instead of the whole item. |
| items4.9.0+ | [] | Item[] |
Array of objects, where each object represents one item - row in table. Additionally, you can add style classes to each row by passing them by '_props' key and to single cell by '_cellProps'. Example item: { name: 'John' , age: 12, _props: { theme: 'success' }, _cellProps: { age: { className: 'fw-bold'}}} |
| itemsPerPage | - | number |
The controlled number of items per page. Pair it with onItemsPerPageChange; for the uncontrolled mode use defaultItemsPerPage instead. Only applicable when pagination is enabled. |
| itemsPerPageLabel | Items per page: | string |
Label for items per page selector. |
| itemsPerPageOptions | [5, 10, 20, 50] | number[] |
Items per page selector options. |
| itemsPerPageSelect | - | boolean |
Adds select element over table, which is used for control items per page in pagination. Only applicable when pagination is enabled. |
| loading | - | boolean |
When set, table will have loading style: loading spinner and reduced opacity. |
| loadingContent6.0.0+ | - | ReactNode |
The content of the cover displayed over the table while loading is set. |
| noItemsLabel | No items found | ReactNode |
ReactNode or string for passing custom noItemsLabel texts. |
| onActivePageChange | - | ((value: number) => void) |
Page change callback. |
| onColumnFilterChange | - | ((value: ColumnFilterValue) => void) |
Column filter change callback. |
| onFilteredItemsChange | - | ((items: Item[]) => void) |
Filtered items change callback. |
| onGlobalFilterChange6.0.0+ | - | ((value: string) => void) |
Global filter change callback. |
| onItemsPerPageChange | - | ((value: number) => void) |
Pagination change callback. |
| onRowChecked5.17.0+ | - | ((item: Item, value: boolean) => void) |
Row checked callback. |
| onRowClick | - | ((item: Item, index: number, columnName: string, event: MouseEvent<Element, MouseEvent>) => void) |
Row click callback. |
| onSelectedChange6.0.0+ | - | ((items: Item[]) => void) |
Selected items change callback. |
| onSorterChange | - | ((value: SorterValue[]) => void) |
Sorter value change callback. |
Enables default pagination. The number of pages is generated from the number of items and itemsPerPage; with external set it is generated from totalItems instead. |
Properties to CSmartPagination component - https://coreui.io/react/docs/components/smart-pagination#csmartpagination |
| scopedColumns | - | ScopedColumns |
Scoped columns. |
| selectable | - | boolean |
Add checkboxes to make table rows selectable. |
| selectAll4.9.0+ | true | boolean |
Enables select all checkbox displayed in the header of the table. |
| selected4.9.0+ | - | Item[] |
The controlled selected items — array of objects, where each object represents one item - row in table. Pair it with onSelectedChange; for the uncontrolled mode use defaultSelected instead. Example item: { name: 'John' , age: 12 } |
| sortAscendingIcon6.0.0+ | (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 512 512"
fill="currentColor"
>
<path d="M390.624 150.625 256 16 121.376 150.625l22.628 22.627 95.997-95.998v417.982h32V77.257l95.995 95.995z" />
</svg>
) | ReactNode |
Sorter icon when items are sorted ascending. |
| sortDescendingIcon6.0.0+ | (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 512 512"
fill="currentColor"
>
<path d="m367.997 338.75-95.998 95.997V17.503h-32v417.242l-95.996-95.995-22.627 22.627L256 496l134.624-134.623z" />
</svg>
) | ReactNode |
Sorter icon when items are sorted descending. |
| sorterValue | - | SorterValue[] |
The controlled state of the sorter. Pair it with onSorterChange; for the uncontrolled mode use defaultSorterValue instead. Each entry names a column and the direction, 'asc' or 'desc'. |
| sortNeutralIcon6.0.0+ | (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 512 512"
fill="currentColor"
>
<path d="M384 433.373V160h-32v274.51l-69.823-69.823-22.627 22.626 107.882 107.883 107.881-107.883-22.626-22.626zM159.432 17.372 51.55 125.255l22.627 22.627L144 78.059V352h32V79.195l68.687 68.687 22.626-22.627z" />
</svg>
) | ReactNode |
Sorter icon when items are unsorted. |
| tableBodyProps | - | CTableBodyProps |
Properties to CTableBody component - https://coreui.io/react/docs/components/table/#ctablebody |
Properties to CTableFoot component - https://coreui.io/react/docs/components/table/#ctablefoot |
| tableHeadProps | - | CTableHeadProps |
Properties to CTableHead component - https://coreui.io/react/docs/components/table/#ctablehead |
| tableProps | - | CTableProps |
Properties to CTable component - https://coreui.io/react/docs/components/table/#ctable |
| totalItems6.0.0+ | - | number |
The total number of items. Use it when you pass a portion of the data from an external source to let the component know how many items there are in total. |