Command Palette

Search for a command to run...

Table

A responsive table component for displaying tabular data with header, body, footer, and caption support.

NameStatusRole
AliceActiveAdmin
BobInactiveUser

Installation

npx shadcn add table --registry https://ui.ch.sh/r

Usage

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

export default function Example() {
  return (
    <Table>
      <TableHeader>
        <TableRow>
          <TableHead>Column 1</TableHead>
          <TableHead>Column 2</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        <TableRow>
          <TableCell>Data 1</TableCell>
          <TableCell>Data 2</TableCell>
        </TableRow>
      </TableBody>
    </Table>
  )
}