DataTable
A table that works like a spreadsheet. Sort, filter, select, and edit rows with the mouse or keyboard. Compose the controls you need.
Installation
Install DataTable from the Fluid Effect UI registry.
Playground
Components
10 / 37 rows
Rows per pagePage 1 of 4
Selection and actions
Team
3 of 12 rows selected
Page 1 of 2
Filters
Invoices
Status
Amountfromto
Saved views
People
Editable cells
Tasks
Resizing and reordering columns
Members
Frozen columns
Accounts
Reordering rows
Launch checklist
Sub-rows
Files
Wrapped text
Changelog
Sorting
Payments
Search and empty
Payments
Loading
Payments
Keyboard
6 rows
⌘ is Ctrl on Windows and Linux. A row under the pointer counts as focused.
API Reference
Types come from the public API. A dash indicates no default is documented here.
DataTable props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
props.label | string | Required | |
props.id | string | Required | |
props.columns | Show typereadonly { readonly header: string; readonly id: string; readonly filter?: boolean | "number" | "text" | "options" | "date"; readonly display?: "keys" | "day" | "dollars" | "euros" | "kilobytes"; readonly width?: number; readonly hidden?: boolean; readonly options?: readonly { readonly value: string; readonly label: string; }[]; readonly editor?: { readonly type: "text"; readonly link?: boolean; readonly placeholder?: string; } | { readonly type: "number"; readonly options?: readonly number[]; readonly placeholder?: string; } | { readonly type: "date"; readonly placeholder?: string; } | { readonly type: "tags"; readonly options?: readonly string[]; readonly placeholder?: string; readonly creatable?: boolean; } | { readonly type: "select"; readonly options: readonly { readonly value: string; readonly label?: string; readonly color?: "gray" | "red" | "amber" | "green" | "blue"; }[]; }; readonly sortable?: boolean; readonly pin?: "left" | "right"; readonly hideable?: boolean; readonly lines?: 1 | 2 | "wrap"; readonly badges?: { readonly [x: string]: "gray" | "red" | "amber" | "green" | "blue"; }; }[] | Required | |
props.rows | Show typereadonly { readonly id: string; readonly values: { readonly [x: string]: string | number | boolean | readonly string[] | null; }; readonly parentId?: string; }[] | Required | |
props.search | string | '' | |
props.disabled | boolean | false | |
props.size | "default" | "compact" | 'default' | |
props.reducedMotion | "user" | "always" | "never" | 'user' | |
props.selectedIds | readonly string[] | [] | |
props.className | string | — | |
props.shape | "rounded" | "pill" | "sharp" | 'rounded' | |
props.toolbar | "text" | "icons" | — | |
props.loading | boolean | — | |
props.empty | boolean | — | |
props.filters | Show typereadonly { readonly id: string; readonly value: { readonly kind: "text"; readonly query: string; readonly op: "is" | "contains" | "is not" | "does not contain" | "starts with" | "ends with" | "is empty" | "is not empty"; } | { readonly kind: "number"; readonly min?: number; readonly max?: number; } | { readonly kind: "date"; readonly op: "between" | "before" | "after"; readonly from: string; readonly to: string; } | { readonly kind: "options"; readonly values: readonly string[]; readonly op: "is" | "is not"; }; }[] | [] | |
props.sorting | readonly { readonly id: string; readonly desc: boolean; }[] | [] | |
props.selectable | boolean | false | |
props.editable | boolean | — | |
props.resizable | boolean | — | |
props.reorderColumns | boolean | — | |
props.reorderRows | boolean | — | |
props.columnVisibility | boolean | — | |
props.expandedIds | readonly string[] | [] | |
props.searchColumn | string | — | |
props.searchPlaceholder | string | 'Search…' | |
props.searchCollapsible | boolean | — | |
props.showTitle | boolean | — | |
props.rowHover | boolean | — | |
props.showFilters | boolean | — | |
props.filtersInitiallyHidden | boolean | — | |
props.showFooter | boolean | — | |
props.layoutSlots | boolean | — | |
props.showSearch | boolean | — | |
props.history | boolean | — | |
props.batchShortcut | boolean | — | |
props.emptyState | { readonly title: string; readonly description?: string; } | — | |
props.pageSize | number | Varies
| |
props.pageSizes | readonly number[] | — | |
props.pageIndex | number | 0 | |
props.rowActions | readonly { readonly value: string; readonly label: string; }[] | [] | |
key | string | undefined | '' | The child's identity among its parent's children of one component. The empty string by default. |
onEmit | Handlers<Msg> | ((event: Event) => NoInfer<Msg> | undefined) | — | |
slots | { readonly toolbarEnd?: View.Input<Msg, R>; readonly beforeTable?: View.Input<Msg, R>; } | — |