MiHCM
data/@mihcm/ui·v0.21.0·stable

DataTable

Full-featured data table powered by TanStack Table v8. Sorting, filtering, pagination, selection, column visibility, expandable rows, column resize, column/row pinning, grouping, and faceted filtering — all via boolean props. 5 visual variants.

Props

The full prop API for DataTable. Same surface in web and React Native — bundlers pick the right variant via the react-native export condition.

PropTypeDefaultDescriptionSince
columnsColumnDef<TData, TValue>[]TanStack Table column definitions. Required.0.5.0
dataTData[]Array of data rows. Required.0.5.0
variant'default' | 'bordered' | 'striped' | 'minimal' | 'card''default'Visual table style. Passed through to the underlying Table primitive.0.6.0
searchablebooleanfalseShow a global search input above the table.0.5.0
searchPlaceholderstring'Search...'Placeholder text for the search input.0.5.0
sortablebooleantrueEnable column header click-to-sort.0.5.0
multiSortbooleanfalseAllow shift+click to sort by multiple columns.0.6.0
paginatedbooleanfalseShow pagination controls below the table.0.5.0
pageSizenumber10Rows per page when paginated is true.0.5.0
pageSizeOptionsnumber[][5, 10, 20, 50]Options for the rows-per-page selector.0.5.0
selectablebooleanfalseAdd a checkbox column for row selection.0.5.0
columnVisibilitybooleanfalseShow a column show/hide dropdown.0.5.0
expandablebooleanfalseEnable expandable rows with a chevron toggle.0.5.0
columnFilterablebooleanfalseShow per-column filter inputs under each header.0.6.0
resizablebooleanfalseEnable column resizing by dragging header edges.0.6.0
columnPinnablebooleanfalseEnable column pinning (left/right).0.6.0
pinnedColumns{ left?: string[]; right?: string[] }Column IDs to pin. Only used when columnPinnable is true.0.6.0
rowPinnablebooleanfalseEnable row pinning (top/bottom).0.6.0
pinnedRows{ top?: string[]; bottom?: string[] }Row IDs to pin. Only used when rowPinnable is true.0.6.0
groupablebooleanfalseEnable row grouping by column with aggregation.0.6.0
facetedbooleanfalseEnable faceted filtering (unique value lists, min/max ranges). Requires columnFilterable.0.6.0
headerToneTableHeaderTone'default'Semantic header color inherited from the Table primitive.0.10.0
headerClassNamestringTokenized Tailwind classes applied to every header cell.0.10.0
widebooleanfalsePreserve readable column widths with horizontal overflow for dense datasets.0.10.0
renderSubComponent(props: { row: Row<TData> }) => ReactNodeContent rendered when a row is expanded.0.5.0
onRowSelectionChange(selection: RowSelectionState) => voidCalled whenever row selection state changes.0.5.0
emptyMessagestring'No results.'Message shown when no rows match filters.0.5.0
classNamestringAdditional Tailwind classes on the root wrapper.0.5.0

Import

import { DataTable, DataTableColumnHeader, createColumnHelper } from '@mihcm/ui/DataTable';