Table

Free

Enhanced table component with multiple variants, sorting, selection, and responsive behavior. Perfect for displaying structured data with modern styling and interactions.

Installation

Install via CLI

npx @moontra/moonui-cli add table

Usage

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00

Examples

Basic Table

Simple table with header, body and caption

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
INV005PaidPayPal$550.00

Striped Rows

variant="striped" zebra-stripes the body rows. The stripe is applied per row (:nth-child(odd)), so it survives fragments, .map() and wrapper components — header and footer rows are never striped. Hover switches to the accent surface so it stays visible on top of a stripe.

Zebra striping makes long rows easier to scan.
NameEmailStatusRole
John Doejohn@example.com
Active
Admin
Jane Smithjane@example.com
Active
User
Bob Johnsonbob@example.com
Inactive
User
Alice Brownalice@example.com
Active
Editor
Charlie Wilsoncharlie@example.com
Pending
User

With Status Badges

Table with status badges for visual indicators

NameEmailStatusRole
John Doejohn@example.com
Active
Admin
Jane Smithjane@example.com
Active
User
Bob Johnsonbob@example.com
Inactive
User
Alice Brownalice@example.com
Active
Editor
Charlie Wilsoncharlie@example.com
Pending
User

With Actions

Table with action dropdown menus

NameEmailRoleActions
John Doejohn@example.comAdmin
Jane Smithjane@example.comUser
Bob Johnsonbob@example.comUser

Sortable Table

Use TableHead's built-in sortable, sorted and onSort props to add sorting without wiring up your own icons

Name
Email
Status
Role
John Doejohn@example.com
Active
Admin
Jane Smithjane@example.com
Active
User
Bob Johnsonbob@example.com
Inactive
User
Alice Brownalice@example.com
Active
Editor
Charlie Wilsoncharlie@example.com
Pending
User

Selectable Rows

Table with checkbox selection

NameEmailStatusRole
John Doejohn@example.com
Active
Admin
Jane Smithjane@example.com
Active
User
Bob Johnsonbob@example.com
Inactive
User
Alice Brownalice@example.com
Active
Editor
Charlie Wilsoncharlie@example.com
Pending
User

Responsive Table

Horizontal scroll on smaller screens

NameEmailStatusRoleDepartmentLocationActions
John Doejohn@example.com
Active
AdminEngineeringSan Francisco
Jane Smithjane@example.com
Active
UserEngineeringSan Francisco
Bob Johnsonbob@example.com
Inactive
UserEngineeringSan Francisco
Alice Brownalice@example.com
Active
EditorEngineeringSan Francisco
Charlie Wilsoncharlie@example.com
Pending
UserEngineeringSan Francisco

Summary Footer, Variants and Sizes

TableFooter renders a <tfoot> for totals and summary rows — it is excluded from striping, so a zebra table keeps a solid summary band. The same table also shows the variant scale beyond striped (card here, plus bordered and minimal) and the size scale that sets the base text size (sm / md / lg).

InvoiceStatusAmount
INV-001Paid$250.00
INV-002Pending$150.00
INV-003Unpaid$350.00
Total$750.00