Table

Styled HTML table primitives and a full-featured data table powered by TanStack Table v8

import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from "@plexui/ui/components/Table";import { DataTable, DataTableColumnHeader } from "@plexui/ui/components/DataTable";

Table Primitives

Overview

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
INV005PaidPayPal$550.00
Total$1,750.00
ProductQtyPriceTotal
Pro Plan3$29.00$87.00
Storage Add-on1$9.00$9.00
Subtotal$96.00

Minimal

NameTitleEmail
Lindsay WaltonFront-end Developerlindsay@example.com
Courtney HenryDesignercourtney@example.com
Tom CookDirector of Producttom@example.com

DataTable

Variant

variant
RoleDepartmentStatus
Lindsay WaltonFront-end DeveloperEngineering
Active
Courtney HenryDesignerDesign
Active
Tom CookDirector of ProductProduct
Active
Whitney FrancisCopywriterMarketing
Inactive
Leonard KrasnerSenior DeveloperEngineering
Active
Floyd MilesUX ResearcherDesign
Active

Sorting

Alicia BellProduct ManagerActive
Anna RobertsBackend DeveloperActive
Benjamin RusselDevOps EngineerActive
Courtney HenryDesignerActive
Emily SelmanVP MarketingActive
Rows per page
1–5 of 15

Pagination

IDNameDepartmentStatus
USR-001Lindsay WaltonEngineeringActive
USR-002Courtney HenryDesignActive
USR-003Tom CookProductActive
USR-004Whitney FrancisMarketingInactive
USR-005Leonard KrasnerEngineeringActive
Rows per page
1–5 of 15

Row click

EmailRole
Lindsay Waltonlindsay@example.comFront-end Developer
Courtney Henrycourtney@example.comDesigner
Tom Cooktom@example.comDirector of Product
Whitney Franciswhitney@example.comCopywriter
Rows per page
1–4 of 8
Click a row to see selected user details.

Cell variants

IDNameStatusJoinedSalary
USR-001Lindsay Walton
Active
Jan 15, 2023, 09:00 AM$95,000
USR-002Courtney Henry
Active
Mar 22, 2023, 09:00 AM$88,000
USR-003Tom Cook
Active
Jun 10, 2022, 09:00 AM$120,000
USR-004Whitney Francis
Inactive
Jul 4, 2023, 09:00 AM$72,000
USR-005Leonard Krasner
Active
Feb 18, 2022, 09:00 AM$115,000
USR-006Floyd Miles
Active
May 11, 2023, 09:00 AM$85,000
Rows per page
1–6 of 15

Filtering

RoleDepartmentStatus
Lindsay WaltonFront-end DeveloperEngineering
Active
Courtney HenryDesignerDesign
Active
Tom CookDirector of ProductProduct
Active
Whitney FrancisCopywriterMarketing
Inactive
Leonard KrasnerSenior DeveloperEngineering
Active
Rows per page
1–5 of 15

Column visibility

RoleDepartmentStatusSalary
Lindsay WaltonFront-end DeveloperEngineering
Active
$95,000
Courtney HenryDesignerDesign
Active
$88,000
Tom CookDirector of ProductProduct
Active
$120,000
Whitney FrancisCopywriterMarketing
Inactive
$72,000
Leonard KrasnerSenior DeveloperEngineering
Active
$115,000
Rows per page
1–5 of 15

Empty state

IDNameEmailStatus
No users found.

Reference

Table Primitives

PropTypeDefaultDescription
TabletableRoot table container with horizontal scroll wrapper
TableHeadertheadTable header group
TableBodytbodyTable body group
TableFootertfootTable footer group
TableRowtrTable row
TableHeadthTable header cell
TableCelltdTable data cell
TableCaptioncaptionTable caption

DataTable

PropTypeDefaultDescription
columnsColumnDef<TData>[]Column definitions following TanStack Table v8 API
dataTData[]Data array to display
variant"default" | "bordered""default"Visual variant — bordered adds a rounded border and tinted header
pageSizenumber10Rows per page. Set 0 or Infinity to disable pagination
initialSortingSortingStateInitial column sorting state
globalFilterstringControlled search/filter string
onGlobalFilterChange(value: string) => voidCallback when filter changes
onRowClick(row: TData) => voidClick handler for rows, makes rows interactive
columnVisibilityVisibilityStateControlled column visibility state
onColumnVisibilityChange(visibility: VisibilityState) => voidCallback when visibility changes
enableRowSelectionbooleanfalseEnable row selection checkboxes
rowSelectionRowSelectionStateControlled row selection state
onRowSelectionChange(selection: RowSelectionState) => voidCallback when selection changes
getRowId(row: TData) => stringCustom row ID accessor
emptyMessageReactNode"No results."Shown when no rows
showPaginationbooleantrueWhether to show pagination controls
classNamestringClass applied to outermost wrapper

DataTableColumnHeader

PropTypeDefaultDescription
columnColumn<TData, TValue>TanStack Table column object
titlestringDisplay text for the header

Column helpers

PropTypeDefaultDescription
idCell(accessor)CellComponentMonospace ID with copy-on-click tooltip
dateTimeCell(accessor, options?)CellComponentFormatted datetime with Intl.DateTimeFormat
statusCell(accessor, colorMap?)CellComponentBadge cell with automatic status-to-color mapping
tooltipHeader(label, description)HeaderComponentHeader with dashed underline and info tooltip