Data Grid

A full-featured data grid with sorting, selection, column resizing, pinned columns, drag-and-drop row reorder, virtualization, and async loading, built on the BlakeUI Table.

CustomerTransaction IDStatusAmountFeeNetPayment MethodRegionDescriptionDate
Emma Wilsonemma@example.com
pay_1N3xDRSucceeded$2,450.00$73.50$2,376.50Visa •••• 4242North AmericaAnnual subscription — Enterprise planDec 6, 2025
Isabella Nguyenisabella@example.com
pay_1N3x9MSucceeded$299.00$8.97$290.03Visa •••• 1234Asia PacificQuarterly subscription — Team planDec 2, 2025
Jackson Leejackson@example.com
pay_1N3x8LProcessing$39.00$1.43$37.57Mastercard •••• 5555North AmericaMonthly add-on — Extra seatsDec 1, 2025
Liam Johnsonliam@example.com
pay_1N3xCQRefunded$150.00$4.50$145.50Mastercard •••• 6789EuropeMonthly subscription — Pro planDec 5, 2025
Olivia Martinolivia@example.com
pay_1N3x7KSucceeded$1,999.00$59.97$1,939.03Visa •••• 4242North AmericaAnnual subscription — Pro planNov 30, 2025
Sofia Davissofia@example.com
pay_1N3xBPSucceeded$450.00$13.50$436.50Visa •••• 9012EuropeOne-time purchase — Enterprise setupDec 4, 2025
William Kimwill@example.com
pay_1N3xANFailed$99.00$3.17$95.83Amex •••• 3782Asia PacificMonthly subscription — Starter planDec 3, 2025

Usage

The DataGrid component takes a flat data array, a columns definition, and a getRowId function. It renders a fully accessible table with built-in support for sorting, selection, column resizing, and more.

import { DataGrid, type DataGridColumn } from "@blakeui/pro-react";

interface Payment {
  id: string;
  customer: string;
  amount: number;
  status: "succeeded" | "failed" | "pending";
}

const data: Payment[] = [
  { id: "1", customer: "Olivia Martin", amount: 316, status: "succeeded" },
  { id: "2", customer: "Jackson Lee", amount: 242, status: "pending" },
];

const columns: DataGridColumn<Payment>[] = [
  { id: "customer", header: "Customer", accessorKey: "customer", isRowHeader: true },
  { id: "amount", header: "Amount", accessorKey: "amount", align: "end" },
  { id: "status", header: "Status", accessorKey: "status" },
];

function App() {
  return (
    <DataGrid
      aria-label="Payments"
      columns={columns}
      data={data}
      getRowId={(item) => item.id}
    />
  );
}

Anatomy

Import the DataGrid component. It is not a compound component and has no DataGrid.* sub-parts.

import { DataGrid } from "@blakeui/pro-react";

<DataGrid />;

Column definitions

Columns are an array of DataGridColumn<T> objects. Each column has an id, a header, and either an accessorKey (to read a value from the row object) or a custom cell renderer. The cell function receives the full row item and returns any ReactNode.

const columns: DataGridColumn<Payment>[] = [
  {
    id: "customer",
    header: "Customer",
    accessorKey: "customer",
    isRowHeader: true,
    allowsSorting: true,
    minWidth: 180,
    cell: (item) => (
      <div className="flex flex-col">
        <span className="font-medium">{item.customer}</span>
        <span className="text-muted text-xs">{item.email}</span>
      </div>
    ),
  },
  {
    id: "amount",
    header: "Amount",
    accessorKey: "amount",
    align: "end",
    allowsSorting: true,
    minWidth: 120,
    cell: (item) => <span className="tabular-nums">${item.amount.toFixed(2)}</span>,
  },
  {
    id: "status",
    header: "Status",
    accessorKey: "status",
    minWidth: 120,
    cell: (item) => (
      <Chip color={STATUS_COLOR[item.status]} size="sm" variant="soft">
        {item.status}
      </Chip>
    ),
  },
];

Custom Cell Rendering

A column's cell function receives the row item and the column definition and returns any ReactNode.

{
  id: "status",
  header: "Status",
  accessorKey: "status",
  cell: (item) => (
    <Chip color={STATUS_COLOR[item.status]} size="sm" variant="soft">
      {item.status}
    </Chip>
  ),
}

Custom Header Rendering

A column's header accepts a string, a ReactNode, or a render function that receives { sortDirection } for sortable columns.

{
  id: "amount",
  accessorKey: "amount",
  align: "end",
  allowsSorting: true,
  header: ({ sortDirection }) => (
    <span className="inline-flex items-center gap-1">
      Amount
      {sortDirection && (
        <Icon
          icon={sortDirection === "ascending" ? "ic:twotone-arrow-upward" : "ic:twotone-arrow-downward"}
          width={14}
          height={14}
        />
      )}
    </span>
  ),
}

Row selection

Enable row selection with selectionMode and showSelectionCheckboxes. Both "single" and "multiple" modes work with controlled or uncontrolled state.

const [selectedKeys, setSelectedKeys] = useState<Selection>(new Set(["1", "3"]));

<DataGrid
  aria-label="Payments"
  columns={columns}
  data={data}
  getRowId={(item) => item.id}
  selectionMode="multiple"
  showSelectionCheckboxes
  selectedKeys={selectedKeys}
  onSelectionChange={setSelectedKeys}
/>;

Bulk actions

Selecting rows raises a Dock — a floating action bar with a live selection count and bulk operations — anchored to the grid; the header checkbox toggles every row at once.

EmployeeDepartmentStatusJoined
AO
Amara Okaforamara.okafor@company.com
SupportpendingJun 26, 2024
ER
Elena Rodriguezelena.rodriguez@company.com
HRactiveJan 27, 2024
JO
James O'Brienjames.o.brien@company.com
FinanceactiveApr 13, 2024
LB
Luca Bianchiluca.bianchi@company.com
EngineeringactiveJul 24, 2024
MC
Marcus Chenmarcus.chen@company.com
DesignpendingFeb 2, 2024
PP
Priya Patelpriya.patel@company.com
HRactiveMar 3, 2024
YT
Yuki Tanakayuki.tanaka@company.com
ProductinactiveMay 7, 2024

Editable cells

Compose editors — inline text, a select, a stepper, and a toggle — into column cell renderers with caller-managed row state; the text editor opens in a popover portaled outside the grid so its keystrokes stay clear of the grid's keyboard navigation.

Feature flags

Edit cells inline — changes write to local state.

FeatureAudienceRolloutEnabled
100%
40%
20%
60%
80%

Team Members

A full-featured team directory composed from the DataGrid primitives — controlled sorting, multi-row selection, pinned Member and actions columns, column resizing and visibility, search, worker-type and status filters, and pagination.

Team Members

100
Worker IDExternal Worker IDMemberCountryRoleWorker TypeStatusStart DateTeams
WRK-7220030EXT-UDSD2TCI
AK
Aisha Khanaisha.khan@company.com
NigeriaData AnalystEmployeeActiveAugust 10, 2021Product EngineeringDataSales+1
WRK-4111752EXT-AUQKB2L9
AR
Aisha Rossiaisha.rossi@company.com
CanadaEngineering ManagerEmployeeActiveMarch 9, 2023DesignSupportData
WRK-1557793EXT-XWB97T7M
AO
Amara Okaforamara.okafor@company.com
NigeriaMarketing ManagerContractorVacationJune 26, 2024GrowthMarketingProduct Engineering
WRK-9647204EXT-G1U8YNQV
AN
Andre Nguyenandre.nguyen@company.com
PortugalSolutions ArchitectEmployeeActiveNovember 20, 2025PlatformMarketingSupport+1
WRK-4377371EXT-BJV7MFJ3
AS
Andre Santosandre.santos@company.com
PortugalSoftware EngineerContractorActiveMarch 14, 2024SecuritySupportMarketing+1
WRK-8300233EXT-2KJA8IEU
AK
Arjun Kimarjun.kim@company.com
CanadaSoftware EngineerEmployeeVacationFebruary 18, 2025Finance
WRK-3677524EXT-EX8VBA1L
AN
Arjun Novakarjun.novak@company.com
MexicoSoftware EngineerEmployeeInactiveApril 10, 2025SalesDesign
WRK-4654746EXT-BN2EGCNZ
AA
Ava Adeyemiava.adeyemi@company.com
PolandFinance AnalystContractorActiveFebruary 20, 2024PlatformFinance
WRK-3946935EXT-I2T9M7M1
AB
Ava Bauerava.bauer@company.com
IrelandTechnical RecruiterContractorActiveMarch 2, 2023InfrastructurePlatformMarketing+1
WRK-2604574EXT-QPMJ8DSP
AR
Ava Reyesava.reyes@company.com
MexicoTechnical RecruiterContractorActiveJuly 2, 2025PlatformMarketingDesign+1
0 of 100 selected
Rows per page

Servers

A server-monitoring grid composed from the DataGrid primitives — controlled sorting, multi-row selection, column visibility and resizing, search, and status filtering, with a circular-progress capacity ring and an inline request sparkline as custom cell renderers.

Servers

100
Cluster IDInstancesStatusRegionCapacityCostRequests
cls-0072be1520Activeap-south-1
86%
$2,980.00
cls-009ac4e74Inactivesa-east-1
33%
$680.00
cls-00a17f3e12Activeus-east-1
72%
$1,840.00
cls-00b42c9d6Activeeu-west-1
48%
$920.00
cls-00c8e51024Activeap-southeast-1
91%
$3,680.00
cls-00d3019a3Inactiveus-west-2
18%
$460.00
cls-00e6b7c216Activeeu-central-1
64%
$2,450.00
cls-00f1d83b8Activeap-northeast-1
78%
$1,230.00
cls-10c5b04b38Activeeu-north-1
37%
$435.80
cls-1c0ff1ce17Activeeu-north-1
29%
$1,807.99
0 of 100 selected
Rows per page

Sorting

Mark columns as sortable with allowsSorting: true. In uncontrolled mode the DataGrid sorts data client-side using locale-aware string comparison (or a column-level sortFn). For server-side sorting, pass a controlled sortDescriptor and handle onSortChange.

Uncontrolled (client-side)

<DataGrid
  aria-label="Payments"
  columns={columns}
  data={data}
  getRowId={(item) => item.id}
  defaultSortDescriptor={{ column: "customer", direction: "ascending" }}
/>

Controlled (server-side)

const [sortDescriptor, setSortDescriptor] = useState<SortDescriptor>({
  column: "amount",
  direction: "descending",
});

<DataGrid
  aria-label="Payments"
  columns={columns}
  data={sortedData}
  getRowId={(item) => item.id}
  sortDescriptor={sortDescriptor}
  onSortChange={setSortDescriptor}
/>;

Custom Sort Function

Provide a custom sortFn on a column for non-default comparison logic; it falls back to locale-aware string comparison.

{
  id: "priority",
  header: "Priority",
  allowsSorting: true,
  sortFn: (a, b) => priorityOrder[a.priority] - priorityOrder[b.priority],
}

Column Resizing

Enable column resizing with allowsColumnResize on the DataGrid and allowsResizing on each resizable column; resizable columns should define a minWidth.

const columns: DataGridColumn<Payment>[] = [
  { id: "customer", header: "Customer", accessorKey: "customer", isRowHeader: true, allowsResizing: true, minWidth: 160 },
  { id: "email", header: "Email", accessorKey: "email", allowsResizing: true, minWidth: 200 },
  { id: "amount", header: "Amount", accessorKey: "amount", align: "end", allowsResizing: true, minWidth: 120 },
];

<DataGrid
  aria-label="Payments"
  columns={columns}
  data={data}
  getRowId={(item) => item.id}
  allowsColumnResize
  onColumnResize={(widths) => console.log("resizing", widths)}
  onColumnResizeEnd={(widths) => console.log("resized", widths)}
/>;

Pinned columns

Pin columns to the start or end edge so they stay visible during horizontal scroll. Pinned columns must have a numeric width or minWidth, and they use logical directions ("start" is left in LTR).

Companies

13
CompanyCategoriesLinkedInLast interactionConnection strengthTwitter followersTwitter
AirbnbB2CInternetMarketplaceairbnbNo contactNo communication883,549Airbnb
AppleB2CConsumer ElectronicsE-commerceappleNo contactNo communication9,119,742Apple
AttioAutomationB2BEnterprise+1attioabout 3 hours agoVery weak1,340attio
DisneyB2CE-commercedisneymusicgroupNo contactNo communication10,140,332Disney
GoogleB2BB2CBroadcasting+1google9 days agoWeak28,946,065Google
IntercomB2BB2CE-commerce+1intercomNo contactNo communication42,427intercom
LVMHB2CConsumer DiscretionaryE-commercelvmhNo contactNo communication198,135LVMH
MicrosoftB2BEnterpriseInformation Technology+1microsoftNo contactNo communication12,814,907Microsoft
OpenPhoneB2BB2CSaaS+2openphone2 days agoWeak8,400OpenPhone
OperaB2CInformation TechnologyBrowsers+1opera-software14 days agoVery weak63,000opera
PayPalB2CFinanceFinancial Services+1paypalNo contactNo communication969,425PayPal
sweetgreenB2CE-commerceFood+1sweetgreenabout 2 hours agoVery strong3,200sweetgreen
United AirlinesAirlinesB2CE-commerce+1united-airlinesNo contactNo communication1,174,209united
13 companies

Drag and drop

Enable row reorder with the onReorder callback. The DataGrid provides built-in drag handles, keyboard support (Enter to grab, arrows to move, Enter to drop), and fires the callback with the reordered data array.

Tasks

8

Drag rows to reorder. Use keyboard (Enter to grab, arrows to move, Enter to drop).

TaskPriorityAssigneeStatus
Design system auditHighOliviaIn Progress
API rate limitingHighJacksonTo Do
Onboarding flow redesignMediumIsabellaIn Progress
Database migration scriptHighWilliamTo Do
Unit test coverage reportLowSofiaDone
Performance profilingMediumLiamTo Do
Accessibility auditMediumEmmaIn Progress
CI pipeline optimizationLowNoahDone

For advanced scenarios (cross-list, custom drag items), pass dragAndDropHooks directly from React Aria Components' useDragAndDrop. When provided, dragAndDropHooks overrides onReorder.

Expandable rows

Render hierarchical data by providing a getChildren function. The DataGrid recursively renders child rows, auto-generates a chevron toggle in the treeColumn, and indents each nested level by treeIndent pixels.

NameTypeSizeDate Modified
DocumentsFolder2 itemsOct 20, 2025
Project AlphaFolder2 itemsAug 2, 2025
Weekly Report.pdfDocument1.2 MBJul 10, 2025
Budget.xlsxDocument48 KBAug 20, 2025
Meeting Notes.mdText12 KBSep 14, 2025
readme.txtText4 KBMar 1, 2026

The treeColumn prop specifies which column displays the chevron. If omitted, it defaults to the first isRowHeader column (or the first column). Use defaultExpandedKeys for uncontrolled expansion, or pair expandedKeys with onExpandedChange for controlled behavior. Set treeIndent={0} to disable automatic per-level indentation. Expandable rows compose with selection, drag-and-drop, sorting, pinned columns, and column resizing.

Empty state

Provide a renderEmptyState function to display a custom empty state when data is empty.

CustomerAmountStatus
No payments yetNew payments will appear here once they are processed.

Async loading

Use onLoadMore, isLoadingMore, and loadMoreContent to implement infinite-scroll loading. The DataGrid renders a sentinel row that triggers onLoadMore when it scrolls into view.

InvoiceCustomerAmountStatus
INV-1001Olivia Martin$120.00paid
INV-1002Jackson Lee$193.00pending
INV-1003Isabella Nguyen$266.00overdue
INV-1004William Kim$339.00paid
INV-1005Sofia Davis$412.00pending
INV-1006Liam Johnson$485.00overdue
INV-1007Emma Brown$558.00paid
INV-1008Noah Wilson$631.00pending
INV-1009Ava Garcia$704.00overdue
INV-1010Lucas Martinez$777.00paid
INV-1011Olivia Martin$850.00pending
INV-1012Jackson Lee$923.00overdue
INV-1013Isabella Nguyen$996.00paid
INV-1014William Kim$189.00pending
INV-1015Sofia Davis$262.00overdue
INV-1016Liam Johnson$335.00paid
INV-1017Emma Brown$408.00pending
INV-1018Noah Wilson$481.00overdue
INV-1019Ava Garcia$554.00paid
INV-1020Lucas Martinez$627.00pending
INV-1021Olivia Martin$700.00overdue
INV-1022Jackson Lee$773.00paid
INV-1023Isabella Nguyen$846.00pending
INV-1024William Kim$919.00overdue
INV-1025Sofia Davis$992.00paid
INV-1026Liam Johnson$185.00pending
INV-1027Emma Brown$258.00overdue
INV-1028Noah Wilson$331.00paid
INV-1029Ava Garcia$404.00pending
INV-1030Lucas Martinez$477.00overdue

Virtualization

Enable row virtualization for large datasets (1,000+ rows) with the virtualized prop. Only visible rows are rendered to the DOM. You must set rowHeight and headingHeight.

Product
1,000 products
Profit: $35,746,445.00Sales: 397,100

CSS Classes

Base Classes

  • .data-grid — Root wrapper. Sets position: relative and width: 100%. Defines --data-grid-selection-column-width and --data-grid-drag-handle-column-width custom properties.

Element Classes

  • .data-grid__selection-column — Narrow <th> for the select-all checkbox. Fixed width from --data-grid-selection-column-width.
  • .data-grid__selection-cell — Narrow <td> for row selection checkboxes. Same fixed width.
  • .data-grid__drag-handle-column — Narrow <th> for the drag handle column. Fixed width from --data-grid-drag-handle-column-width.
  • .data-grid__drag-handle-cell — Narrow <td> for the drag handle. Same fixed width.
  • .data-grid__drag-handle — The grip button inside each row. Styled with cursor: grab and subtle color.
  • .data-grid__sort-icon — Chevron indicator next to sortable column headers. Rotates 180° when descending.
  • .data-grid__empty-state — Centered container for the empty state message. Muted text, vertical padding.
  • .data-grid__tree-cell — Flex wrapper inside the treeColumn cell that holds the chevron toggle and cell content. Per-level indentation is applied inline via padding-inline-start.
  • .data-grid__tree-toggle — Expand/collapse chevron button, rendered when a row has children. Sized via --data-grid-tree-toggle-size.
  • .data-grid__tree-toggle-icon — Chevron icon inside the toggle. Rotates 90° when the row is expanded via [data-expanded].
  • .data-grid__tree-toggle-spacer — Invisible placeholder rendered for leaf rows so their content aligns with sibling rows that have a chevron.

Interactive States

  • Drag handle hover: &:hover / [data-hovered="true"] on .data-grid__drag-handle — text transitions to foreground.
  • Drag handle pressed: &:active / [data-pressed="true"] on .data-grid__drag-handle — cursor changes to grabbing.
  • Drag handle focus: [data-focus-visible="true"] on .data-grid__drag-handle — applies focus ring via status-focused.
  • Row dragging: .table__row[data-dragging="true"] — reduced opacity (0.5).
  • Drop indicator: .react-aria-DropIndicator[data-drop-target] td — accent background line.

Alignment

  • [data-align="end"] — Right-aligns both header and cell content.
  • [data-align="center"] — Center-aligns both header and cell content.

Vertical Alignment

Controlled by the verticalAlign prop via [data-vertical-align] on the root:

  • [data-vertical-align="top"]vertical-align: top (flexbox items-start in virtualized mode).
  • [data-vertical-align="middle"]vertical-align: middle (flexbox items-center in virtualized mode).
  • [data-vertical-align="bottom"]vertical-align: bottom (flexbox items-end in virtualized mode).

Pinned Columns

  • [data-pinned] — Makes the cell position: sticky with z-index: 2.
  • [data-pinned="start"] — Sticky to inset-inline-start.
  • [data-pinned="end"] — Sticky to inset-inline-end.
  • [data-pinned-edge] — Boundary column that shows a separator line when the pinned group detaches from the scrollable content.
  • [data-pinned-start-detached] — Set on root when content has scrolled past the start-pinned columns. Shows separator via ::after.
  • [data-pinned-end-detached] — Set on root when content hasn't scrolled to the end edge. Shows separator via ::after.

CSS Variables

  • --data-grid-selection-column-width — Width of the selection checkbox column (default: 40px).
  • --data-grid-drag-handle-column-width — Width of the drag handle column (default: 32px).
  • --data-grid-tree-toggle-size — Size of the expand/collapse chevron button and its leaf-row spacer (default: 24px).
  • --data-grid-tree-gap — Gap between the chevron/spacer and the cell content in a treeColumn cell (default: 4px).

API Reference

DataGrid

The root data grid component. Accepts a generic type parameter T for the row data shape.

PropTypeDefaultDescription
dataT[]Row data array.
columnsDataGridColumn<T>[]Column definitions.
getRowId(item: T) => string | numberExtracts a unique key from each row item.
aria-labelstringAccessible label for the table. Required.
variant"primary" | "secondary""primary"Visual variant passed to the underlying Table.
classNamestringAdditional className for the root wrapper.
contentClassNamestringAdditional className for the inner <table> element (e.g. min-w-[1200px] for horizontal scroll).
scrollContainerClassNamestringAdditional className for the scroll container (e.g. max-h-[400px] overflow-y-auto).
verticalAlign"top" | "middle" | "bottom""middle"Vertical alignment of cell content within each row.
selectionMode"none" | "single" | "multiple""none"Row selection mode.
selectedKeysSelectionControlled selected row keys.
defaultSelectedKeysSelectionDefault selected row keys (uncontrolled).
onSelectionChange(keys: Selection) => voidCallback when selection changes.
selectionBehavior"toggle" | "replace""toggle"Selection interaction model.
showSelectionCheckboxesbooleanfalseAuto-prepend a checkbox column for selection.
sortDescriptorSortDescriptorControlled sort descriptor. When provided, sorting is controlled externally.
defaultSortDescriptorSortDescriptorDefault sort descriptor (uncontrolled).
onSortChange(descriptor: SortDescriptor) => voidCallback when sort changes. Fires in both controlled and uncontrolled modes.
allowsColumnResizebooleanfalseEnable column resizing on columns that opt in.
onColumnResize(widths: Map<string | number, ColumnSize>) => voidCallback during column resize.
onColumnResizeEnd(widths: Map<string | number, ColumnSize>) => voidCallback when resize ends.
onReorder(event: DataGridReorderEvent<T>) => voidConvenience callback for row reorder. Enables built-in drag-and-drop. Mutually exclusive with dragAndDropHooks.
dragAndDropHooksDragAndDropHooksAdvanced React Aria Components drag-and-drop hooks for custom DnD scenarios. Overrides onReorder.
onRowAction(key: string | number) => voidCallback when a row is actioned (e.g. double-click or Enter).
rowClassName(item: T) => string | undefinedAdditional className for a row, computed per item (e.g. exit transitions on rows being removed).
renderEmptyState() => ReactNodeRender function for the empty state when data is empty.
onLoadMore() => voidCallback when the load-more sentinel scrolls into view.
isLoadingMorebooleanfalseWhether more data is currently being fetched.
loadMoreContentReactNodeContent to show inside the load-more sentinel row (e.g. a Spinner).
disabledKeysIterable<string | number>Keys of rows that should be disabled.
virtualizedbooleanfalseEnable row virtualization for large datasets. Requires rowHeight and headingHeight.
rowHeightnumber42Fixed row height in pixels. Required when virtualized is true.
headingHeightnumber36Header row height in pixels. Required when virtualized is true.
getChildren(item: T) => T[] | undefinedReturn child rows for a given item. Providing this enables expandable/tree rows.
treeColumnstringColumn id that displays the expand/collapse chevron. Defaults to the first isRowHeader column, or the first column.
expandedKeysSelectionControlled set of expanded row keys.
defaultExpandedKeysSelectionDefault expanded row keys (uncontrolled).
onExpandedChange(keys: Selection) => voidCallback when expanded rows change.
treeIndentnumber20Pixels of inline-start padding added per nested level on the treeColumn cell. Set to 0 to disable.

DataGridColumn<T>

Column definition object passed to the columns prop.

PropertyTypeDefaultDescription
idstringUnique column identifier. Used as the sort key and React Aria Components column id. Required.
headerReactNode | ((info: { sortDirection?: SortDirection }) => ReactNode)Column header content. String, node, or render function receiving sort info.
accessorKeykeyof T & stringKey on T to read the cell value from. Used for default rendering and sorting.
cell(item: T, column: DataGridColumn<T>) => ReactNodeCustom cell renderer. Receives the row item and column definition.
isRowHeaderbooleanfalseMark this column as the row header (for accessibility).
allowsSortingbooleanfalseAllow this column to be sorted.
sortFn(a: T, b: T) => numberCustom sort comparator. Falls back to locale-aware string comparison.
allowsResizingbooleanAllow this column to be resized. Only effective when allowsColumnResize is true on the DataGrid.
widthColumnSizeInitial/controlled column width (px, %, or fr).
minWidthnumberMinimum column width when resizing.
maxWidthnumberMaximum column width when resizing.
align"start" | "center" | "end""start"Cell text alignment.
headerClassNamestringAdditional className appended to every <th> for this column.
cellClassNamestringAdditional className appended to every <td> for this column.
pinned"start" | "end"Pin this column so it stays visible during horizontal scroll. Uses logical directions (start = left in LTR). Pinned columns must have a numeric width or minWidth.

DataGridReorderEvent<T>

Event object passed to the onReorder callback.

PropertyTypeDescription
keysSet<string | number>The keys that were moved.
target{ key: string | number; dropPosition: "before" | "after" }The target row key and drop position.
reorderedDataT[]The full reordered data array after applying the move.

Type Exports

The following types are re-exported from the DataGrid module for convenience:

TypeOriginDescription
DataGridSelectionreact-aria-components SelectionRepresents a set of selected keys, or "all".
DataGridSortDescriptorreact-aria-components SortDescriptorDescribes the current sort column and direction.
DataGridSortDirectionreact-aria-components SortDirection"ascending" | "descending".
DataGridColumnSizeA number, a numeric string, a percentage string, or a fractional unit string.

All other props are forwarded to the root element.

On this page