UI.MD

Search documentation

Search for components, guides, and tokens

Table

A responsive data table with sortable columns, per-column alignment, numeric formatting, and content-sized columns by default. Align by content type: text left, magnitudes right (numeric), identifier numbers (IDs/SKUs) left, action and icon-only columns right or center. Defaults to auto-layout: columns size to their content, visual rhythm comes from consistent cell padding. Opt into layout="fixed" when you need predictable widths.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/table.json

Usage

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

Examples

Default

ProductPriceSalesRevenue
Super Life$29847$24,563
Super Work$29623$18,067
Super Budget$191,204$22,876
Super Goals$19956$18,164

Sortable

Click any column header to sort. Click again to reverse direction.

Building AI-Powered Business ToolsPublishedMar 15, 20262,847
The Case for Variable FontsPublishedMar 8, 20261,923
Design Systems That ScaleDraftMar 1, 20260
Typography on the Modern WebPublishedFeb 22, 20263,102
From Figma to CodePublishedFeb 15, 20261,456

Striped

ProductStatusPriceSalesRevenue
Super LifeActive$29847$24,563
Super WorkActive$29623$18,067
Super BudgetActive$191,204$22,876
Super GoalsDraft$190$0
Super ReadsActive$24412$9,888
Super NotesActive$19738$14,022

With Selected Row

ProductPriceSalesRevenue
Super Life$29847$24,563
Super Work$29623$18,067
Super Budget$191,204$22,876
Super Goals$19956$18,164