import { CSmartTable } from '@coreui/react-pro'
// or
import CSmartTable from '@coreui/react-pro/src/components/smart-table/CSmartTable'
PropertyDescriptionTypeDefault
activePageSets active page. If 'pagination' prop is enabled, activePage is set only initially.number1
cleanerWhen set, displays table cleaner above table, next to the table filter (or in place of table filter if tableFilter prop is not set)
Cleaner resets tableFilterValue, columnFilterValue, sorterValue. If clean is possible it is clickable (tabIndex="0" role="button", color="danger"), otherwise it is not clickable and transparent. Cleaner can be customized through the cleaner slot.
boolean-
clickableRowsStyle table items as clickable.boolean-
columnFilterWhen 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:
- external (Boolean) - Disables automatic filtering inside component.
- lazy (Boolean) - Set to true to trigger filter updates only on change event.
boolean | ColumnFilter-
columnFilterValueValue of table filter. To set pass object where keys are column names and values are filter strings e.g.:
{ user: 'John', age: 12 }
ColumnFilterValue-
columnSorterEnables 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:
- external (Boolean) - Disables automatic sorting inside component.
- resetable (Boolean) - If set to true clicking on sorter have three states: ascending, descending and null. That means that third click on sorter will reset sorting, and restore table to original order.
boolean | Sorter-
columnsProp for table columns configuration. If prop is not defined, table will display columns based on the first item keys, omitting keys that begins with underscore (e.g. '_classes')

In columns prop each array item represents one column. Item might be specified in two ways:
String: each item define column name equal to item value.
Object: item is object with following keys available as column configuration:
- key (required)(String) - define column name equal to item key.
- label (String) - define visible label of column. If not defined, label will be generated automatically based on column name, by converting kebab-case and snake_case to individual words and capitalization of each word.
- _classes (String/Array/Object) - adds classes to all cels in column
- _style (String/Array/Object) - adds styles to the column header (useful for defining widths)
- sorter (Boolean) - disables sorting of the column when set to false
- filter (Boolean) - removes filter from column when set to false.
(string | Column)[]-
elementCover
4.9.0+
ReactNode for passing custom CElementCover content.ReactNode-
footerIf 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: { color: 'success' }, ...]
boolean | (string | FooterItem)[]-
headerSet to false to remove table header.booleantrue
items
4.9.0+
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: { color: 'success' }, _cellProps: { age: { className: 'fw-bold'}}}
Item[]-
itemsNumberThe total number of items. Use if you pass a portion of data from an external source to let know component what is the total number of items.number-
itemsPerPageNumber of items per site, when pagination is enabled.number10
itemsPerPageLabelLabel for items per page selector.stringItems per page:
itemsPerPageOptionsItems per page selector options.number[][5, 10, 20, 50]
itemsPerPageSelectAdds select element over table, which is used for control items per page in pagination. If you want to customize this element, pass object with optional values:
- label (String) - replaces default label text
- values (Array) - custom array of pagination values
- external (Boolean) - disables automatic 'itemsPerPage' change (use to change pages externaly by 'pagination-change' event).
boolean | ItemsPerPageSelect-
loadingWhen set, table will have loading style: loading spinner and reduced opacity.boolean-
noItemsLabelReactNode or string for passing custom noItemsLabel texts.ReactNodeNo items found
onActivePageChangePage change callback.(value: number) => void-
onColumnFilterChangeColumn filter change callback.(value: ColumnFilterValue) => void-
onFilteredItemsChangeFiltered items change callback.(items: Item[]) => void-
onItemsPerPageChangePagination change callback.(value: number) => void-
onRowClickRow click callback.(item: Item, index: number, columnName: string, event: boolean | MouseEvent<Element, MouseEvent>) => void-
onSelectAll
4.9.0+
Select all callback.() => void-
onSelectedItemsChangeSelected items change callback.(items: Item[]) => void-
onSorterChangeSorter value change callback.(value: SorterValue) => void-
onTableFilterChangeTable filter change callback.(value?: string) => void-
paginationEnables default pagination. Set to true for default setup or pass an object with additional CPagination props. Default pagination will always have the computed number of pages that cannot be changed. The number of pages is generated based on the number of passed items and 'itemsPerPage' prop. If this restriction is an obstacle, you can make external CPagination instead.boolean | Pagination-
paginationPropsProperties to CSmartPagination component - https://coreui.io/react/docs/components/smart-pagination#csmartpaginationCSmartPaginationProps-
scopedColumnsScoped columns.ScopedColumns-
selectAll
4.9.0+
Enables select all checkbox displayed in the header of the table.

Can be customized, by passing prop as object with additional options as keys. Available options:
- external (Boolean) - Disables automatic selection inside the component.
boolean | { external?: boolean; }true
selectableAdd checkboxes to make table rows selectable.boolean-
selected
4.9.0+
Array of selected objects, where each object represents one item - row in table.

Example item: { name: 'John' , age: 12 }
Item[]-
sorterValueState of the sorter. Name key is column name, direction can be 'asc' or 'desc'.SorterValue-
sortingIconSorter icon when items are unsorted.ReactNode<CIcon width={18} icon={cilSwapVertical} key="csv" />
sortingIconAscendingSorter icon when items are sorted ascending.ReactNode<CIcon width={18} icon={cilArrowTop} key="cat" />
sortingIconDescendingSorter icon when items are sorted descending.ReactNode<CIcon width={18} icon={cilArrowBottom} key="cab" />
tableBodyPropsProperties to CTableBody component - https://coreui.io/react/docs/components/table/#ctablebodyCTableBodyProps-
tableFilterWhen set, displays table filter above table, allowing filtering by specific column.

Column filter can be customized, by passing prop as object with additional options as keys. Available options:
- external (Boolean) - Disables automatic filtering inside component.
- lazy (Boolean) - Set to true to trigger filter updates only on change event.
boolean | TableFilter-
tableFilterLabelThe element represents a caption for a component.stringFilter:
tableFilterPlaceholderSpecifies a short hint that is visible in the search input.stringtype string...
tableFilterValueValue of table filter.string-
tableFootPropsProperties to CTableFoot component - https://coreui.io/react/docs/components/table/#ctablefootCTableFootProps-
tableHeadPropsProperties to CTableHead component - https://coreui.io/react/docs/components/table/#ctableheadCTableHeadProps-
tablePropsProperties to CTable component - https://coreui.io/react/docs/components/table/#ctableCTableProps-
On this page