Menu

Table

Data table rows + table. 4 types.

OrderCustomerStatus
#1042Nusrat JahanPacking
#1041Tanvir AhmedDelivered
#1040Sadia RahmanCancelled

Installation

$ npx uix-ui@latest add table

This copies the file into components/ui/table.tsx in your project. npx shadcn@latest add @uix/table works too.

Usage

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

<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Order</TableHead>
      <TableHead>Customer</TableHead>
      <TableHead>Status</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow><TableCell>#1042</TableCell><TableCell>Nusrat Jahan</TableCell><TableCell><Badge color="warning">Packing</Badge></TableCell></TableRow>
    <TableRow><TableCell>#1041</TableCell><TableCell>Tanvir Ahmed</TableCell><TableCell><Badge color="success">Delivered</Badge></TableCell></TableRow>
    <TableRow><TableCell>#1040</TableCell><TableCell>Sadia Rahman</TableCell><TableCell><Badge color="error">Cancelled</Badge></TableCell></TableRow>
  </TableBody>
</Table>

Examples

Selectable rows

OrderCustomerTotal
#1042Nusrat Jahan৳1,260
#1041Tanvir Ahmed৳840
#1040Sadia Rahman৳2,100

Props

PropTypeDefaultDescription
frameClassNamestring–Classes for the scrolling frame around the table.

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
This file exports 6 parts: Table, TableHeader, TableBody, TableRow, TableHead, TableCell. Use only the ones you need.
esc

↑↓ to navigate · ↵ to select · esc to close