MiComponents/Documentation

Table

A component for displaying tabular data with header, body, and optional footer sections.

Installation

npx micomponents-cli add table

Preview

NameEmailRole
Johnjohn@example.comAdmin
Janejane@example.comUser

Usage

Import

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

Basic Usage

<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Name</TableHead>
      <TableHead>Email</TableHead>
      <TableHead>Role</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>John</TableCell>
      <TableCell>john@example.com</TableCell>
      <TableCell>Admin</TableCell>
    </TableRow>
  </TableBody>
</Table>

Invoices Table

Display data with caption and footer.
A list of your recent invoices.
InvoiceStatusAmount
INV-001Paid$250.00
INV-002Pending$150.00
INV-003Pending$350.00

API Reference

PropTypeDefaultDescription
TableReact.HTMLAttributes<HTMLTableElement>-Main table container
TableHeaderReact.HTMLAttributes<HTMLTableSectionElement>-Table header section
TableBodyReact.HTMLAttributes<HTMLTableSectionElement>-Table body section
TableRowReact.HTMLAttributes<HTMLTableRowElement>-Table row element
TableHeadReact.ThHTMLAttributes<HTMLTableCellElement>-Table header cell
TableCellReact.TdHTMLAttributes<HTMLTableCellElement>-Table data cell