--- title: "Data Table" slug: data-table category: component type: overview version: 20.0.0 tokens: 636 source: https://ovh.github.io/design-system/v20.0.0/llms/react-components-data-table.txt --- # Data Table ## Props | Property | Type | Required | Default | Description | |---|---|---|---|---| | `columns` | `DataTableColumnDef[]` | Yes | undefined | The columns definitions. | | `data` | `T[]` | Yes | undefined | The table data to display. | | `enableMultiRowSelection` | `boolean` | No | undefined | Whether the multi row selection is enabled. | | `enableRowSelection` | `boolean | (row: DataTableRow) => boolean` | No | undefined | Whether the row selection is enabled. | | `enableSorting` | `boolean` | No | undefined | Whether the column sorting is enabled. | | `getRowId` | `(originalRow: T, index: number, parent: DataTableRow) => string` | No | undefined | By default, the component will look for an id attribute in a data item to identify each row. Using this function, you can define another attribute to use instead (like uuid). | | `i18n` | `Partial` | No | undefined | Internal translations override. | | `loading` | `boolean` | No | undefined | Whether the table data are in a loading state. This will replace each cell with a Skeleton. | | `locale` | `'de' | 'en' | 'es' | 'fr' | 'it' | 'nl' | 'pl' | 'pt'` | No | undefined | The locale used for the translation of the internal elements. | | `manualSorting` | `boolean` | No | undefined | Whether the sorting is handled outside of the table. Use this is the sorting is managed on server-side. | | `onColumnPinningChange` | `OnChangeFn` | No | undefined | Callback fired when the pinned columns changes. | | `onColumnVisibilityChange` | `OnChangeFn` | No | undefined | Callback fired when the column visibility changes. | | `onRowSelectionChange` | `OnChangeFn` | No | undefined | Callback fired when the selected rows changes. | | `onSortingChange` | `OnChangeFn` | No | undefined | Callback fired when the columns sorting changes. | | `state` | `DataTableState` | No | undefined | The controlled table values. | | `stickyHeader` | `boolean` | No | undefined | Whether the header should be sticky. | ## Examples - Default - Empty - Pagination Example - Pinned Columns - State Controlled - Sorting Custom Function - Sorting Disabled Columns - Sorting Controlled - Visibility Example - Accessibility I18n ## Documentation pages - [Documentation](./react-components-data-table--documentation.txt) - [Technical Information](./react-components-data-table--technical-information.txt) - [Examples](./react-components-data-table--examples.txt)