Vesture
Get started

Data

DataGrid

A virtualized, sortable, filterable, resizable data table — the most involved component in the library, and the one built for real production datasets rather than demo lists.

DataGrid

Preview

Email
Status
Jane Doe
jane@example.com
Design
Active
Alex Kim
alex@example.com
Engineering
Active
Sam Patel
sam@example.com
Product
Active
Priya Nair
priya@example.com
Engineering
On leave
Diego Cruz
diego@example.com
Design
Active
Mei Chen
mei@example.com
Product
Active

Usage

tsx
import { DataGrid } from "@vesture/react";

<DataGrid
  columns={[
    { key: "name", header: "Name", sortable: true },
    { key: "email", header: "Email", filterable: true },
  ]}
  data={users}
  getRowId={(u) => u.id}
  selectable
  onRowEdit={(id, values) => saveUser(id, values)}
/>

Behavior

  • Row virtualization computed manually from scrollTop / rowHeight / overscan — no external virtualization dependency.
  • Column resize via Pointer Events on a role="separator" handle; columns can pin left or right and stay sticky during horizontal scroll.
  • Inline row editing: Enter saves, Escape cancels.
  • Controlled independently for sort, filters, and selectedIds — or hand serverSide off to your own API.

Props

DataGridColumn<T>

PropTypeDefaultDescription
keystringColumn id / fallback data key.
headerReactNodeHeader cell content.
width / minWidthnumber160 / 60Sizing in px.
sortable / resizable / filterablebooleanEnable per-column features.
pinned"left" | "right"Freeze column during horizontal scroll.
editablebooleanAllow inline editing when a row is in edit mode.
filterType"text" | "select""text"Filter input kind.
accessor(row: T) => string | numberCustom value getter.
render(row: T) => ReactNodeCustom cell renderer.

DataGrid<T>

PropTypeDefaultDescription
columns / data / getRowIdrequiredColumn defs, row data, and a row key extractor.
rowHeight / height / overscannumber40 / 400 / 5Virtualization tuning.
selectable / selectedIds / onSelectionChangemixedRow selection, controllable.
sort / onSortChangeSortState | nullControlled sort.
filters / onFilterChangeFilterState[]Controlled filters (text input debounced 200ms).
serverSidebooleanfalseTreat data as pre-sorted/filtered/paginated by the caller.
loadingbooleanfalseShows a Spinner overlay without unmounting rows.
page / pageSize / onPageChange / totalRowCountmixedEnables a built-in Pagination footer.
onRowEdit(rowId, values) => voidEnables inline editing; called on save.