Skip to content

Table

Data Display

HTML table primitives (Table, TableHeader, TableBody, TableRow, TableCell) with consistent styling.

CaptionStatus cellsSummary footer
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Compose semantic table elements for small static datasets. Use TableCaption for context and TableHead for column labels. Choose DataTable when you need filtering or pagination.

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

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Table props
PropType / DefaultDescription
childrenReactNode

Default: —

Compose header, body, footer, and caption slots.
classNamestring

Default: —

Extend styles on each slot.
colSpan (TableCell)number

Default: 1

Number of columns spanned by a cell.

Build with these too