Components/Data display/Table
COMPONENT43.43

Table

Data table with hairline rows, compact headers and muted hover. Wrap in .table to scroll on small screens.


INSTALL

1pnpm dlx @sayagodev/mo add table

Or import the files from the package (no copy):

1import "@sayagodev/mo/css/table.css";2import "@sayagodev/mo/js/data-table.js";

EXAMPLES

Recent invoices
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
INV006PendingBank Transfer$200.00
INV007UnpaidCredit Card$300.00
Total$2,250.00
Row actions
ProductPriceActions
Wireless Mouse $29.99
Mechanical Keyboard $129.99
USB-C Hub $49.99
Footer totals
A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
Total$750.00
Payment details
InvoiceStatusMethodAmount
INV001 Paid Card €250.00
INV002 Pending Transfer €150.00
INV003 Unpaid Card €350.00
Sortable columns
A list of your recent invoices.
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
INV005PaidPayPal$550.00
INV006PendingBank Transfer$200.00
INV007UnpaidCredit Card$50.00
Row selection
Status Priority
Refactor auth flow Done High
Ship dark mode In Progress Medium
Update docs Backlog Low
Fix pagination bug Done High
Pagination
Your recent payments across all workspaces.
Invoice Status Method Amount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
INV005PaidPayPal$550.00
INV006PendingBank Transfer$200.00
INV007UnpaidCredit Card$50.00
INV008PaidPayPal$100.00
INV009PaidCredit Card$800.00
INV010UnpaidBank Transfer$300.00
INV011PaidPayPal$120.00
INV012PendingCredit Card$640.00
INV013PaidBank Transfer$75.00
INV014PaidCredit Card$500.00
INV015UnpaidPayPal$90.00
INV016PendingCredit Card$275.00
INV017PaidBank Transfer$330.00
INV018PaidCredit Card$210.00
INV019UnpaidPayPal$60.00
INV020PaidCredit Card$480.00
INV021PendingBank Transfer$185.00
INV022PaidPayPal$95.00
22 row(s)
Filtering

USAGE

1<div class="table">        <!-- horizontal scroll wrapper -->2  <table>3    <caption></caption>4    <thead><tr><th></th></tr></thead>5    <tbody><tr><td></td></tr></tbody>6    <tfoot><tr><td></td></tr></tfoot>7  </table>8</div>

API

NAMEKINDDESCRIPTION
.tableclassScroll container for small screens
tfootelementMuted surface, medium weight
captionelementStyled below the table
--mo-table-cell-*tokenCell padding hooks

FILES

src/css/table.csssrc/js/data-table.js
Install:mo add table

THEMING · PLAYGROUND

This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.

Tokens & hooks — edit live
Global tokens
--border--foreground--muted--muted-foreground--ring
Component hooks
--mo-table-cell-padding-x--mo-table-cell-padding-y

Preview

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
INV006PendingBank Transfer$200.00
INV007UnpaidCredit Card$300.00
Total$2,250.00

Your CSS

Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.