bearnie

Table

Display structured tabular data.

Name Status Role
Alice Active Admin
Bob Inactive User

Installation

npx bearnie add table
npx bearnie add table

Usage

import {
  Table,
  TableHeader,
  TableBody,
  TableRow,
  TableHead,
  TableCell,
} from "@/components/bearnie/table"
<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Column</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>Data</TableCell>
    </TableRow>
  </TableBody>
</Table>

Examples

With caption

A list of recent invoices.
Invoice Status Amount
INV001 Paid $250.00
INV002 Pending $150.00
Item Price
Product A $100.00
Product B $50.00
Total $150.00

With badges

Name Status Role
Alice Johnson
Active
Admin
Bob Smith
Inactive
User

Anatomy

  • Table - The root table element
  • TableHeader - Container for header rows
  • TableBody - Container for body rows
  • TableFooter - Container for footer rows
  • TableRow - A single table row
  • TableHead - Header cell
  • TableCell - Body/footer cell
  • TableCaption - Table caption text

Props

All Table components accept class for additional CSS classes. They are structural components wrapping native HTML table elements.