Table

A set of composable table subcomponents for displaying structured, tabular data with sortable columns, row striping, and hover highlights.

Installation

npx @obi/ui add table

Preview

NameRoleStatus
Alice KimDesignerActive
Ben TorresEngineerActive
Clara PatelPMOn leave

Usage

import {
  Table,
  TableHead,
  TableBody,
  TableRow,
  TableHeader,
  TableCell,
} from '@/src/components/Table/Table';

export default function Example() {
  return (
    <Table>
      <TableHead>
        <TableRow header>
          <TableHeader>Name</TableHeader>
          <TableHeader>Role</TableHeader>
          <TableHeader>Status</TableHeader>
        </TableRow>
      </TableHead>
      <TableBody>
        <TableRow>
          <TableCell>Alice Chen</TableCell>
          <TableCell>Engineer</TableCell>
          <TableCell>Active</TableCell>
        </TableRow>
        <TableRow>
          <TableCell>Bob Ruiz</TableCell>
          <TableCell>Designer</TableCell>
          <TableCell>Active</TableCell>
        </TableRow>
        <TableRow>
          <TableCell>Carol Smith</TableCell>
          <TableCell>Manager</TableCell>
          <TableCell>Away</TableCell>
        </TableRow>
      </TableBody>
    </Table>
  );
}

Props

NameTypeDefaultDescription
stripedbooleanfalseAlternates odd/even row background colors in the body.
classNamestring""Additional classes merged onto the table element.