1. Docs
  2. Components
  3. Table

Table

A responsive table component.

Component table-demo not found in registry.

Installation

npx shadcn@latest add @kanpeki/table

Anatomy

import { Table } from "~/components/ui/table";

<Table.Root>
  <Table.Caption>A list of your recent invoices.</Table.Caption>
  <Table.Header>
    <Table.Row>
      <Table.Head className="w-[100px]">Invoice</Table.Head>
      <Table.Head>Status</Table.Head>
      <Table.Head>Method</Table.Head>
      <Table.Head className="text-right">Amount</Table.Head>
    </Table.Row>
  </Table.Header>
  <Table.Body>
    <Table.Row>
      <Table.Cell className="font-medium">INV001</Table.Cell>
      <Table.Cell>Paid</Table.Cell>
      <Table.Cell>Credit Card</Table.Cell>
      <Table.Cell className="text-right">$250.00</Table.Cell>
    </Table.Row>
  </Table.Body>
  <Table.Footer>
    <Table.Row>
      <Table.Cell colSpan={3}>Total</Table.Cell>
      <Table.Cell className="text-right">$2,500.00</Table.Cell>
    </Table.Row>
  </Table.Footer>
</Table.Root>

Examples

Sorting

Component Tabs.le-sorting not found in registry.

Resizable

Component Tabs.le-resizable not found in registry.

API Reference

Root

PropTypeDefault
allowResize
boolean
false
selectionBehavior
enum
"toggle"
disabledBehavior
enum
"selection"
selectionMode
enum
disallowEmptySelection
boolean