Table

A plain table styled as a macOS list: grey column titles, stripes and an accent selected row.

@cupertinoui/tableRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/table

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

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

<Table>
  <TableHeader>
    <TableRow><TableHead>Name</TableHead></TableRow>
  </TableHeader>
  <TableBody>
    <TableRow><TableCell>Xcode</TableCell></TableRow>
  </TableBody>
</Table>
For files and folders with sorting, expanding and selection, use File List Table.

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

TableRow

PropTypeDescription
data-state"selected"Highlights the row with the accent color.
classNamestringExtra classes, merged with the component's own.

Table / TableHeader / TableBody / TableFooter / TableHead / TableCell / TableCaption

PropTypeDescription
classNamestringExtra classes, merged with the component's own.