Skip to content

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 page
Page 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

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
PropTypeDefaultDescription
props.labelstringRequired
props.idstringRequired
props.columns
Show type
readonly { 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 type
readonly { readonly id: string; readonly values: { readonly [x: string]: string | number | boolean | readonly string[] | null; }; readonly parentId?: string; }[]
Required
props.searchstring''
props.disabledbooleanfalse
props.size"default" | "compact"'default'
props.reducedMotion"user" | "always" | "never"'user'
props.selectedIdsreadonly string[][]
props.classNamestring—
props.shape"rounded" | "pill" | "sharp"'rounded'
props.toolbar"text" | "icons"—
props.loadingboolean—
props.emptyboolean—
props.filters
Show type
readonly { 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.sortingreadonly { readonly id: string; readonly desc: boolean; }[][]
props.selectablebooleanfalse
props.editableboolean—
props.resizableboolean—
props.reorderColumnsboolean—
props.reorderRowsboolean—
props.columnVisibilityboolean—
props.expandedIdsreadonly string[][]
props.searchColumnstring—
props.searchPlaceholderstring'Search…'
props.searchCollapsibleboolean—
props.showTitleboolean—
props.rowHoverboolean—
props.showFiltersboolean—
props.filtersInitiallyHiddenboolean—
props.showFooterboolean—
props.layoutSlotsboolean—
props.showSearchboolean—
props.historyboolean—
props.batchShortcutboolean—
props.emptyState{ readonly title: string; readonly description?: string; }—
props.pageSizenumber
Varies
  • 5
  • Math.max(1, count)
props.pageSizesreadonly number[]—
props.pageIndexnumber0
props.rowActionsreadonly { readonly value: string; readonly label: string; }[][]
keystring | undefined''The child's identity among its parent's children of one component. The empty string by default.
onEmitHandlers<Msg> | ((event: Event) => NoInfer<Msg> | undefined)—
slots{ readonly toolbarEnd?: View.Input<Msg, R>; readonly beforeTable?: View.Input<Msg, R>; }—