Table
Displays rows of data in columns, with optional sortable headers and pinned columns.
Show codeHide code
Installation
import {
Table,
TableHeader,
TableBody,
TableRow,
TableHead,
TableCell,
TableActionCell,
TableEditableCell,
} from "@makeplane/propel/components/table";Usage
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@makeplane/propel/components/table";
const COLUMNS = ["Name", "Email", "Account type"];
const PEOPLE = [
{ name: "Astra", email: "astra.terra@example.com", role: "Admin" },
{ name: "Nova", email: "nova.star@example.com", role: "Member" },
{ name: "Lyra", email: "lyra.constellation@example.com", role: "Guest" },
];
export default function BasicDemo() {
return (
<Table variant="table">
<TableHeader>
<TableRow>
{COLUMNS.map((c) => (
<TableHead key={c} pinned="none" label={c} />
))}
</TableRow>
</TableHeader>
<TableBody>
{PEOPLE.map((person) => (
<TableRow key={person.email}>
<TableCell pinned="none" padding="cell">
{person.name}
</TableCell>
<TableCell pinned="none" padding="cell">
{person.email}
</TableCell>
<TableCell pinned="none" padding="cell">
{person.role}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
);
}Table requires variant (table | spreadsheet). Plain TableHead / TableCell require pinned
(none | start | end). Plain cells also require padding (cell for normal content, trigger
when a full-cell control fills the cell). TableActionCell and TableEditableCell set
pinned="none" and padding="trigger" for you.
Name the table for assistive tech with a preceding heading, or pass aria-label / aria-labelledby
on Table when the page has more than one data table. Header cells default to scope="col"; for a
leading column that names each row, pass scope="row" on that cell.
Examples
Spreadsheet
variant="spreadsheet" fully borders every cell into a grid, in contrast to variant="table" which
keeps row dividers only.
Show codeHide code
Sortable
A header with sortable and onSort renders its label as a button with a sort chevron. Clicking
cycles none → asc → desc; aria-sort is set for asc/desc and omitted while unsorted.
Show codeHide code
Rich rows
Cells can carry a leading Avatar, an inline TableEditableCell that opens a menu to change its
value, and a trailing icon-only TableActionCell for row actions. While an editable cell’s menu is
open, pass selected for the stronger open tint — it’s visual only; the menu trigger already
exposes open state via aria-expanded.
Show codeHide code
Large tables
Table paints the rows you pass — it is not a data grid. Prefer pagination or
app-side virtualization for many rows. Each TableEditableCell / TableActionCell mounts its own
Menu; at high row counts, share one menu with
createMenuHandle instead of a menu per cell.
Cell slots and disabled
TableCell accepts endIcon (and startIcon) for trailing chrome. TableEditableCell and
TableActionCell accept disabled so the full-cell trigger cannot open its menu.
Show codeHide code
With pagination
Table and Pagination are separate — slice the rows for the current page and drive page /
pageSize from the pager below.
Show codeHide code
Pinned columns
In a height- and width-constrained frame the header stays pinned to the top on vertical scroll, and a column whose head and cells set pinned="start" or pinned="end" stays put on horizontal scroll.
Show codeHide code
API Reference
Table
The ready-made table: the styled `<table>` wrapped in a rounded, hairline-bordered scroll frame, sharing its layout `variant` with the cells/heads via context. The Base UI `ScrollArea` behavior grafts onto the styled `TableScrollArea` frame + viewport (and the overlay scrollbars) via `render`, behavior part outer.
TableHeader
Header section (`<thead>`). Holds a single `TableRow` of `TableHead` cells.
TableBody
Body section (`<tbody>`). Holds the data `TableRow`s.
TableRow
A table row (`<tr>`).
TableHead
A ready-made header cell: a plain title, or (when sortable) a sort-cycling button with a chevron.
TableCell
A ready-made data cell: optional leading/trailing slots around a truncating content region.
TableActionCell
An icon-only action cell (`<td>`) that opens a row-actions menu.
TableEditableCell
An editable data cell (`<td>`) with a full-cell menu trigger.