Skip to content

Data display

Table

Table styles the native HTML table for structured, read-only data: quiet headers, hairline rows, hover or zebra rows, right-aligned tabular figures for numbers, totals in a footer and an optional sticky header. It scrolls sideways inside its own frame, so the page never does. For sorting, search, selection and pagination, use Data table.

On this page
March invoices
InvoiceCustomerIssuedStatusAmount
INV-2041Fernhill StudioMar 02, 2026Paid$4,200.00
INV-2042QuillmarkMar 04, 2026Pending$1,180.50
INV-2043Tidewell LogisticsMar 09, 2026Overdue$12,940.00
INV-2044Copperleaf DentalMar 11, 2026Paid$860.00
INV-2045Halden WorksMar 15, 2026Draft$2,315.75
Total$21,496.25

Usage

components/ui/table.tsx
import { Table, TableBody, TableHead, Td, Th, Tr } from "@/components/ui/table"; <Table framed label="Invoices">  <TableHead>    <tr><Th>Customer</Th><Th numeric>Amount</Th></tr>  </TableHead>  <TableBody>    <Tr><Td>Fernhill Studio</Td><Td numeric>$4,200.00</Td></Tr>  </TableBody></Table>

Examples

Overview

March invoices
InvoiceCustomerIssuedStatusAmount
INV-2041Fernhill StudioMar 02, 2026Paid$4,200.00
INV-2042QuillmarkMar 04, 2026Pending$1,180.50
INV-2043Tidewell LogisticsMar 09, 2026Overdue$12,940.00
INV-2044Copperleaf DentalMar 11, 2026Paid$860.00
INV-2045Halden WorksMar 15, 2026Draft$2,315.75
Total$21,496.25

Basic

Without a frame the table sits flush in a card or page section. Rows highlight on hover by default.

NameRoleLast active
Ada MorenoOwner2 min ago
Theo LindqvistAdmin1 hour ago
Priya RamanMemberYesterday

Zebra rows, numbers and footer

Striped rows help the eye across wide rows of figures. numeric right-aligns cells and uses tabular monospaced digits so columns line up; TdHead makes the first cell a row header. A visible caption sits under the table.

Net revenue in USD, fiscal year 2025. Figures are fictional.
RegionQ1Q2Q3Q4
North America$182,400$201,950$214,300$236,120
Europe$141,020$150,880$149,300$171,640
Asia Pacific$96,310$104,220$118,940$127,560
Latin America$38,450$41,120$44,780$51,230
Middle East & Africa$22,910$25,300$27,640$30,180
Total$481,090$523,470$554,960$616,730

Set stickyHeader with a maxHeight and the body scrolls under the header inside the frame.

TimeEventObjectStatus
09:41:12payout.paidpo_8Hc21200
09:40:58invoice.sentin_3Kd90200
09:40:31invoice.finalizedin_3Kd90200
09:39:47customer.updatedcu_7Pa12200
09:38:05charge.failedch_1Lm44402
09:37:22charge.succeededch_1Lm43200
09:36:10invoice.paidin_3Kc88200
09:35:02webhook.retrywh_9Qe01500
09:34:48customer.createdcu_7Pa13201
09:33:15payout.createdpo_8Hc21200
09:32:51invoice.sentin_3Kc88200
09:31:40charge.succeededch_1Lm42200

Props

Table

  • framedbooleandefault: falseBordered, rounded frame on the surface color.
  • stripedbooleandefault: falseZebra rows.
  • hoverbooleandefault: trueHighlight the row under the pointer.
  • density"compact" | "normal" | "relaxed"default: "normal"Row height: 36, 44 or 56 px.
  • stickyHeaderbooleandefault: falseKeep the header in view while the body scrolls.
  • maxHeightnumber | stringdefault: —Height of the scroll area; needed for a sticky header.
  • labelstringdefault: —Names the scroll region and makes it focusable for keyboard scrolling.

Th, Td, TdHead, Tr

  • Th align / numeric"left" | "center" | "right" / booleandefault: "left"Header alignment; numeric right-aligns.
  • Th scope"col" | "row"default: "col"Header scope.
  • Td numericbooleandefault: —Right-aligned, monospaced tabular figures.
  • Td mutedbooleandefault: —Secondary text color for dates and IDs.
  • Td colSpannumberdefault: —Span several columns (totals, empty rows).
  • Tr selectedbooleandefault: —Accent-tinted background for a selected row.

TableHead, TableBody, TableFoot, TableCaption

  • TableCaption srOnlybooleandefault: —Hide the caption visually when a heading already describes the table.
  • classNamestringdefault: —Extra classes on the section.

Accessibility

  • It is a real table element, so screen readers announce rows, columns and header cells as you move through it.
  • Th uses scope="col" and TdHead uses scope="row", so every cell is read with its column and row headers.
  • Give each table a caption (visible, or srOnly when a heading already says the same) so it can be found in a screen reader's table list.
  • When a label is set, the horizontal scroll area becomes a focusable region, so keyboard users can scroll it with the arrow keys.
  • Status cells use a badge with a word, never color alone.

Suggested