Uiplex

Table

A table component for displaying tabular data with head, body, footer, and configurable variants and sizes.

Basic Usage

NameEmailRole
Jane Doejane@example.comAdmin
John Smithjohn@example.comUser
import {
  Table,
  TableHead,
  TableBody,
  TableRow,
  TableHeader,
  TableCell,
} from 'uiplex';

<Table>
  <TableHead>
    <TableRow>
      <TableHeader>Name</TableHeader>
      <TableHeader>Email</TableHeader>
      <TableHeader>Role</TableHeader>
    </TableRow>
  </TableHead>
  <TableBody>
    <TableRow>
      <TableCell>Jane Doe</TableCell>
      <TableCell>jane@example.com</TableCell>
      <TableCell>Admin</TableCell>
    </TableRow>
    <TableRow>
      <TableCell>John Smith</TableCell>
      <TableCell>john@example.com</TableCell>
      <TableCell>User</TableCell>
    </TableRow>
  </TableBody>
</Table>

Variants

Default

ProductPrice
Widget A$10
Widget B$20

Bordered

ProductPrice
Widget A$10
Widget B$20

Striped

ProductPrice
Widget A$10
Widget B$20
Widget C$30
<Table variant="default">...</Table>
<Table variant="bordered">...</Table>
<Table variant="striped">...</Table>

Sizes

Small

Col 1Col 2
Row 1Data

Medium (default)

Col 1Col 2
Row 1Data

Large

Col 1Col 2
Row 1Data
<Table size="sm">...</Table>
<Table size="md">...</Table>
<Table size="lg">...</Table>

With Footer

ItemQtyAmount
Widget A2$20
Widget B1$20
Total$40
<Table variant="bordered">
  <TableHead>...</TableHead>
  <TableBody>...</TableBody>
  <TableFooter>
    <TableRow>
      <TableCell colSpan={2}>Total</TableCell>
      <TableCell>$60</TableCell>
    </TableRow>
  </TableFooter>
</Table>

API Reference

Table

PropTypeDefaultDescription
variant"default" | "bordered" | "striped""default"Visual style of the table
size"sm" | "md" | "lg""md"Cell padding and font size
classNamestring""Additional CSS classes
styleReact.CSSProperties-Inline styles

TableHead, TableBody, TableFooter, TableRow

PropTypeDefaultDescription
childrenReact.ReactNode-Table section content
classNamestring""Additional CSS classes

TableHeader, TableCell

PropTypeDefaultDescription
childrenReact.ReactNode-Cell content
colSpannumber-Number of columns to span (HTML attribute)
rowSpannumber-Number of rows to span (HTML attribute)
classNamestring""Additional CSS classes