# DataTable

Wires TanStack Table's row model to the Table parts, adding sorting and optional pagination. Use it for tabular data that needs behaviour rather than markup.

Package: `@kela-systems/ui-components` 4.1.0

```tsx
import { DataTable } from "@kela-systems/ui-components";
```

Links (Kela sign-in needed): [Storybook](https://main--6af1efd9453270bb59a6c00c.chromatic.com/?path=/docs/components-datatable--docs), [Source](https://github.com/Kela-Systems/kela/tree/main/packages/next/ui-components/src/data-table), [Figma](https://www.figma.com/design/anhlwrbFM6mUiL0klxeK1I/ARK---Design-System?node-id=244-2897)

## Props

A `className` on a part adds layout only: placement, sizing and spacing. Pick a look with a variant.

### DataTable

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `columns` (required) | `ColumnDef<TData, TValue>[]` |  |  |
| `data` (required) | `TData[]` |  |  |
| `paginated` | `boolean` | `false` | Adds the previous/next footer and slices rows to pageSize. |
| `pageSize` | `number` | `10` | Rows per page. An options.initialState value is spread later and wins. |
| `emptyMessage` | `React.ReactNode` | `No results.` | Accepts text or a composed <Empty> for a richer empty state. |
| `loading` | `boolean` | `false` | Renders pageSize placeholder rows with one Skeleton per column. |
| `labels` | `Partial<DataTableLabels>` |  | Overrides pagination copy while retaining English defaults. |

Also takes the props of `@tanstack/react-table`.
