Table

A set of components for displaying tabular data.

$bunx shadcn@latest add @nx-ui/table
Registry item
Installs withutils
Used bydata-tableopportunities

Basic table

Header, body and a caption describing the dataset. Cells stay on a single line and the container scrolls horizontally when the columns overflow.

Waste movements logged this week across the Northern network.
ReferenceCarrierWaste streamTonnage
MOV-4821Pennine HaulageMixed dry recyclate12.4 t
MOV-4822Clyde Waste LogisticsContaminated soil28.0 t
MOV-4823Severn ReclamationGreen garden waste6.75 t
MOV-4824Anglia Skip HireHazardous sludge3.10 t

Status column

A dedicated column rendering Badge variants keeps consignment states scannable at a glance.

ReferenceCarrierWaste streamStatus
MOV-4821Pennine HaulageMixed dry recyclateSettled
MOV-4822Clyde Waste LogisticsContaminated soilIn transit
MOV-4823Severn ReclamationGreen garden wasteSettled
MOV-4824Anglia Skip HireHazardous sludgeRejected

Selectable rows

A checkbox column with a header select-all toggle. Selected rows carry data-[state=selected], which tints the row from the component's own styles.

ReferenceCarrierStatusTonnage
MOV-4821Pennine HaulageSettled12.4 t
MOV-4822Clyde Waste LogisticsIn transit28.0 t
MOV-4823Severn ReclamationSettled6.75 t
MOV-4824Anglia Skip HireRejected3.10 t

API reference

Exported parts and their props, extracted from the component source.