Reference index

Components

Table

Semantic table in Barlow: heavy header rule, hairline rows, tabular right-aligned figures.

Preview

Stories filed this week, by desk.
DeskStoriesWords
Politics4251,230
Business3744,105
Culture1923,870
Science1115,402
Total109134,607

Install

bash

npx shadcn add @eloquent/table

Usage

tsx

import {
  Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow,
} from "@/components/ui/table";

<Table scrollLabel="Stories by desk">
  <TableCaption>Stories filed this week, by desk.</TableCaption>
  <TableHeader>
    <TableRow>
      <TableHead>Desk</TableHead>
      <TableHead numeric>Stories</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>Politics</TableCell>
      <TableCell numeric>42</TableCell>
    </TableRow>
  </TableBody>
</Table>

Mark figure columns numeric. Pass scrollLabel when the table may be wider than its container, so keyboard users can scroll it.

States

StoryStatus
Budget passes second readingPublished
Port strike enters third daySelected
Museum reopens its east wingDraft
StateTreatment
HeaderKicker capitals between a 3px ink rule and a hairline
RowsHairline between rows, 44px high; no hover fill
Selected rowdata-state="selected": tint-1 fill
Scroll region focus2px ink outline, 2px offset

Keyboard

KeyAction
TabWith scrollLabel, focuses the table's scroll region; without it, the table is skipped
Arrow Left / RightScroll a focused, wide table sideways

Vietnamese

Số bài nộp trong tuần, theo ban.
BanSố bàiSố chữ
Chính trị4251.230
Kinh doanh3744.105
Văn hoá1923.870
Khoa học1115.402
Tổng109134.607

Ink adaptation

Upstream shadcn's grey row borders, muted header and hover fill are replaced by ink rules: a heavy rule over the header, hairlines between rows and no hover effect. Figures are right-aligned and tabular. Native HTML, no Base UI part (Base UI has no table).