Components

A structured layout for displaying tabular data.

CustomerDate/TimeTotalStatus
Alex Cooper

Feb 17, 2024

08:48 AM

$1042.25

Paid

Cameron Williamson

Feb 17, 2024

08:48 AM

$1042.25

Pending

Lindsay Walton

Feb 17, 2024

08:48 AM

$1042.25

Paid

Leonard Krasner

Feb 17, 2024

08:48 AM

$1042.25

Returned

Installation

npm install @mijn-ui/react-table

Usage

import {
  Table,
  TableBody,
  TableCaption,
  TableCell,
  TableHeader,
  TableHeaderCell,
  TableRow,
} from "@mijn-ui/react-table"
<Table>
  <TableCaption>A list of your recent invoices.</TableCaption>
  <TableHeader>
    <TableRow>
      <TableHeaderCell className="w-[100px]">Invoice</TableHeaderCell>
      <TableHeaderCell>Status</TableHeaderCell>
      <TableHeaderCell>Method</TableHeaderCell>
      <TableHeaderCell className="text-right">Amount</TableHeaderCell>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell className="font-medium">INV001</TableCell>
      <TableCell>Paid</TableCell>
      <TableCell>Credit Card</TableCell>
      <TableCell className="text-right">$250.00</TableCell>
    </TableRow>
  </TableBody>
</Table>

API Reference

Standard element attributes are forwarded to the underlying component in addition to the props below.

PropTypeDefaultDescription
unstyledbooleanfalseOpt out of the default styles to fully customize the component.
classNamesobjectOverride classes per slot (see Style Slots below).
classNamestringAdditional classes for the root element.

Table Style Slots

Slot NameTargeted ComponentPurpose
baseTableStyles the root table component.
headerTableHeaderStyles the table header.
bodyTableBodyStyles the table body.
footerTableFooterStyles the table footer.
rowTableRowStyles table rows.
headerCellTableHeaderCellStyles individual header cells.
cellTableCellStyles individual cells.
captionTableCaptionStyles the table caption.