Table
Rows and columns on a rounded surface: sortable headers, density, stripes, sticky header, and cards on phones.
import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, TableFooter } from "pleate/table";Sortable, stacks on phones
| Booking | City | Status | |||
|---|---|---|---|---|---|
| BookingHT-2042 | GuestOmar Haddad | CityKyoto | Nights6 | Total€1,290 | StatusPending |
| BookingHT-2045 | GuestAiko Tanaka | CityHanoi | Nights5 | Total€640 | StatusConfirmed |
| BookingHT-2044 | GuestJonas Berg | CityNaples | Nights4 | Total€512 | StatusCancelled |
| BookingHT-2041 | GuestSofia Rossi | CityLisbon | Nights3 | Total€384 | StatusConfirmed |
| BookingHT-2043 | GuestChiara Bianchi | CitySeville | Nights2 | Total€218 | StatusConfirmed |
Loading and empty
| Guest | City | Total |
|---|---|---|
Props
- density
Row height.
"comfortable" | "compact"default "comfortable"- striped
Tint every other row.
booleandefault false- hoverable
Highlight the row under the pointer.
booleandefault true- stickyHeader
Keep the header visible while the body scrolls.
booleandefault false- loading
Skeleton rows in place of the body while data loads.
booleandefault false- columns
Cells per skeleton row, to match your columns.
numberdefault 4- skeletonRows
How many skeleton rows.
numberdefault 4- empty
Empty state shown instead of the body rows.
{ icon?, title, description?, actions? }- stackOnMobile
Rows become cards below md; set TableCell label.
boolean- TableHead sort / onSort / align
Sortable column.
"asc" | "desc" | false / () => void / "start" | "center" | "end"
Accessibility
- Sortable headers are buttons inside th with aria-sort.
- Stacked rows keep the real table semantics; headers stay for screen readers.