Morpha UI
ComponentsData Display

Table

Display tabular data with semantic rows and columns.

Overview

A table displays tabular data using semantic markup. Compose it from TableHeader, TableBody, TableRow, TableHead, TableCell, and an optional TableCaption.

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
$ npx morpha-ui add table

Examples

With status cells

EnvironmentStatus
ProductionActive
StagingIdle
LegacyFailed

Installation

Morpha UI components are distributed via the Morpha CLI (coming in a later step): npx morpha-ui add table. In the meantime, since this is the base shadcn component, you can also add it directly:

npx shadcn@latest add table

API Reference

The Table root forwards <table> attributes. The sub-components — TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, and TableCaption — wrap their corresponding HTML table elements.

Prop

Type

Accessibility

  • Describe the table's purpose with a TableCaption.
  • Use TableHead for column headers so screen readers associate cells with headers.
  • Keep the markup semantic (thead/tbody/tr/th/td) rather than styling generic elements.

On this page