Display & Navigation · Tablestable
Table
A bordered data table with sortable headers, row selection, status pills, amounts, toolbar, footer and a mobile row.
Preview
#previewSwitch density, striping, toolbar, footer and a row state. Show code opens the React and CSS below.
| Payment | Customer | Status | Amount |
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
| pay_7Hc1Vb | Globex | Failed | $412.00 |
compact · no · yes · yes · default
table-example.tsx
import { Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow } from "@blade-ai/weft/components/table";
export function PaymentsTable({ payments }: Props) {
return (
<Table accessibilityLabel="Payments" toolbar={<TableToolbar title="Showing 1–3 of 240 payments" />} footer={<TableFooter page={1} pageCount={80} onPageChange={setPage} />}>
<TableHeader>
<TableRow>
<TableHeaderCell>Payment</TableHeaderCell>
<TableHeaderCell>Customer</TableHeaderCell>
<TableHeaderCell align="right">Amount</TableHeaderCell>
</TableRow>
</TableHeader>
<TableBody>
{payments.map((p) => (
<TableRow key={p.id}>
<TableCell>{p.id}</TableCell>
<TableCell>{p.customer}</TableCell>
<TableCell align="right"><TableAmount value={p.amount} /></TableCell>
</TableRow>
))}
</TableBody>
</Table>
);
}All states
#all-statesDensity, striping, row states, header sort, toolbar, bulk toolbar, summary row, footer, status pills and the mobile row.
| Payment | Customer | Status | Amount |
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
| pay_7Hc1Vb | Globex | Failed | $412.00 |
Compact
| Payment | Customer | Status | Amount |
|---|---|---|---|
pay_8Fk2LmCard | Acme Studio | Settled | $1,240.00 |
pay_3Qd9ZxBank transfer | Northwind | Pending | $86.50 |
Expanded · secondary line
| Payment | Customer | Status | Amount |
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
| pay_7Hc1Vb | Globex | Failed | $412.00 |
Striped
| Payment | Customer | Status | Amount |
|---|---|---|---|
| Hover | Acme Studio | Settled | $1,240.00 |
| Focus | Northwind | Pending | $86.50 |
| Active | Globex | Failed | $412.00 |
| Selected | Initech | Review | -$90.00 |
Row states · hover, focus, active, selected
| Status | |||
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
Sortable headers
| Payment | Amount | |
|---|---|---|
| pay_8Fk2Lm | $1,240.00 | |
| pay_3Qd9Zx | $86.50 |
Select cells
| Payment | Customer | Status | Amount |
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
Toolbar
| Payment | Customer | Status | Amount |
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
Bulk toolbar
| Payment | Customer | Status | Amount |
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
| Total | $1,326.50 |
Summary row
| Payment | Customer | Status | Amount |
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
Footer · simple
| Payment | Customer | Status | Amount |
|---|---|---|---|
| pay_8Fk2Lm | Acme Studio | Settled | $1,240.00 |
| pay_3Qd9Zx | Northwind | Pending | $86.50 |
Footer · numbered
SettledPendingFailedReviewDraft
Status pills
Acme Studiopay_8Fk2Lm · Oct 2, 2026$1,240.00Settled
Mobile row
Props
#propsTable and its parts. Compose them with the native thead, tbody and tfoot structure.
Table
Prop
Type
Default
Description
density
"compact" | "expanded"
"compact"
44px (compact) or 60px (expanded, two-line cells) body rows.
isStriped
boolean
false
Alternate body rows get the faint fill.
toolbar
ReactNode
—
Optional TableToolbar rendered above the grid.
footer
ReactNode
—
Optional TableFooter rendered below the grid.
accessibilityLabel
string
—
Accessible name of the table.
children
ReactNode
—
TableHeader, TableBody and TableSummaryRow. Required.
TableRow
Prop
Type
Default
Description
isSelected
boolean
false
Moderate fill; also sets aria-selected.
onClick
() => void
—
Makes the whole row a focusable target (Enter and Space).
data-state
"hover" | "focus" | "active"
—
Docs and testing hook: forces a row state.
TableCell
Prop
Type
Default
Description
align
"left" | "right" | "center"
"left"
Text alignment.
secondary
ReactNode
—
Muted second line for expanded density.
TableHeaderCell
Prop
Type
Default
Description
align
"left" | "right" | "center"
"left"
Text alignment.
sortDirection
"ascending" | "descending" | "none"
—
Shows the sort button and sets aria-sort. Pass "none" when sortable but unsorted.
onSort
() => void
—
Fires from the sort button. The app owns the order.
TableSelectCell
Prop
Type
Default
Description
isChecked
boolean
—
Selected state. Required.
isIndeterminate
boolean
—
Partly selected, for the select-all header.
onChange
(isChecked: boolean) => void
—
Fires with the next value. Required.
accessibilityLabel
string
—
For example "Select row". Required.
isHeader
boolean
false
Renders a th for select-all.
TableAmount
Prop
Type
Default
Description
value
number
—
Amount. Muted currency and cents around a medium integer part. Required.
currency
string
"$"
Currency symbol.
TableStatus
Prop
Type
Default
Description
type
"positive" | "notice" | "negative" | "information" | "neutral"
—
Pill colour. Required.
children
ReactNode
—
Status text. Required.
TableToolbar
Prop
Type
Default
Description
title
ReactNode
—
Left text, for example "Showing 1–10 of 240 payments".
actions
ReactNode
—
Right-side buttons (size xsmall).
selectedCount
number
0
Above 0 switches to the bulk-action bar.
selectedLabel
ReactNode
"N selected"
Text for the bulk bar.
onDeselect
() => void
—
Fires from the Deselect link in the bulk bar.
bulkActions
ReactNode
—
Right-side actions while rows are selected.
TableFooter
Prop
Type
Default
Description
summary
ReactNode
—
Left text (simple variant).
variant
"simple" | "numbered"
"simple"
simple: "Page 1 of 24" with arrows. numbered: full Pagination.
page
number
—
Current page. Required.
pageCount
number
—
Total pages. Required.
onPageChange
(page: number) => void
—
Fires with the new page. Required.
totalItems
number
—
numbered only: enables "Showing 11–20 of 240".
pageSize
number
—
numbered only.
pageSizeOptions
number[]
—
Shows "Rows per page" (numbered only).
onPageSizeChange
(pageSize: number) => void
—
numbered only.
TableMobileRow
Prop
Type
Default
Description
title
ReactNode
—
Primary line. Required.
subtitle
ReactNode
—
Muted line under the title.
trailing
ReactNode
—
Right column: amount over status.
onClick
() => void
—
Renders the row as a button.
TableSummaryRow
Prop
Type
Default
Description
children
ReactNode
—
Totals cells (TableCell). Rendered as a tfoot row.
TableHeader, TableBody
Prop
Type
Default
Description
…
HTMLAttributes
—
Thin wrappers over thead and tbody. All native attributes pass through.
Usage
#usageShort rules for choosing and writing tables.
Do
Right-align numbers and use TableAmount for money.
Make only sortable columns sortable and show the current direction.
Use the expanded density when a cell needs a second line.
Swap to TableMobileRow on narrow screens.
Don't
Do not use a table for layout.
Do not put long paragraphs in cells.
Do not hide the only way to act on a row behind hover.
Do not use more than one status column per row.
Accessibility
#accessibilityNative table semantics. Sort buttons set aria-sort and selection sets aria-selected.
Keyboard
Key
Action
Tab
Moves through sort buttons, row checkboxes and clickable rows.
Enter / Space
Sorts the column, toggles the checkbox, or opens a clickable row.
Space on checkbox
Toggles selection for that row.
ARIA
Element
Role / attribute
When
Table
<table> · aria-label
Name from accessibilityLabel.
Header cell
scope="col" · aria-sort
Sort button only: ascending, descending or none.
Row
aria-selected
When the row is selected.
Toolbar
role="toolbar" · aria-live="polite"
The count text announces selection changes.
Select cell
Checkbox · aria-label
Name comes from accessibilityLabel.