Skip to content
Components

Table

Responsive data table for lists, comparisons, and structured records.

Examples

Sticky header

maxHeight turns the table into a vertical scroll region, and stickyHeader keeps the column headings pinned while the rows scroll beneath them.

Composition

Anatomy

  • <Table>
    • <TableCaption />
    • <TableHeader>
      • <TableRow>
        • <TableHead />
        </TableRow>
      </TableHeader>
    • <TableBody>
      • <TableRow>
        • <TableCell />
        </TableRow>
      </TableBody>
    • <TableFooter>
      • <TableRow>
        • <TableCell />
        </TableRow>
      </TableFooter>
    </Table>

Clickable rows

TableRowLink turns the whole row into its hit area: the row paints --cui-table-row-hover-background on hover and the focus ring while the link has focus. It renders a button; pass render={<a href />} to navigate. Other buttons, links, and checkboxes in the row stay clickable above it.

  • <Table>
    • <TableBody>
      • <TableRow>
        • <TableCell>
          • <TableRowLink />
          </TableCell>
        </TableRow>
      </TableBody>
    </Table>

Installation

The Control UI source installs this component from src/registry/sources/control-ui/ui/table.tsx.

Registry command
See registry manifest

Dependencies

Raw code

Primary installed source

src/registry/sources/control-ui/ui/table.tsx

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-table-* · 12 knobsHow the cascade resolves
--cui-table-background<color>transparent
--cui-table-foreground<color>var(--foreground)
--cui-table-border-color<color>var(--border)
--cui-table-border-width<length>var(--control-rim-width)
--cui-table-cell-padding<length-percentage>calc(var(--spacing) * 2)
--cui-table-head-height<length-percentage>var(--control-h-lg)
--cui-table-row-hover-background<color>oklch(from var(--foreground) l c h / 0.03)
--cui-table-row-selected-background<color>oklch(from var(--foreground) l c h / 0.05)
--cui-table-header-foreground<color>var(--muted-foreground)
--cui-table-footer-background<color>oklch(from var(--foreground) l c h / 0.03)
--cui-table-header-sticky-background<color>var(--background)
--cui-table-header-sticky-shadow*inset 0 calc(var(--cui-table-border-width) * -1) 0 var(--cui-table-border-color)