Table
A Duostrap structured table preserving classic pixel proportions, bordered and condensed variants, and contextual row tones.
Duostrap Table layers the archived .table typography (14px/20px), 8px cell padding, and top-rule rhythm over Base Table, with optional classic variants for .table-bordered, .table-condensed, .table-striped, .table-hover, and contextual row tones.
For sorting, filtering, pagination, and row selection, use Data Table.
Preview
Section titled “Preview”<div class="w-full overflow-x-auto">
<duostrap-table-root>
<duostrap-table-caption>
A list of your recent invoices.
</duostrap-table-caption>
<duostrap-table-row section="header">
<duostrap-table-header-cell
header-key="invoice"
header-kind="column"
style="width: 100px"
>
Invoice
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="status"
header-kind="column"
>
Status
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="method"
header-kind="column"
>
Method
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="amount"
header-kind="column"
style="text-align: end"
>
Amount
</duostrap-table-header-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv001"
header-kind="row"
>
INV001
</duostrap-table-header-cell>
<duostrap-table-cell>Paid</duostrap-table-cell>
<duostrap-table-cell>Credit Card</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$250.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv002"
header-kind="row"
>
INV002
</duostrap-table-header-cell>
<duostrap-table-cell>Pending</duostrap-table-cell>
<duostrap-table-cell>PayPal</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$150.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv003"
header-kind="row"
>
INV003
</duostrap-table-header-cell>
<duostrap-table-cell>Unpaid</duostrap-table-cell>
<duostrap-table-cell>Bank Transfer</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$350.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv004"
header-kind="row"
>
INV004
</duostrap-table-header-cell>
<duostrap-table-cell>Paid</duostrap-table-cell>
<duostrap-table-cell>Credit Card</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$450.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv005"
header-kind="row"
>
INV005
</duostrap-table-header-cell>
<duostrap-table-cell>Paid</duostrap-table-cell>
<duostrap-table-cell>PayPal</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$550.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv006"
header-kind="row"
>
INV006
</duostrap-table-header-cell>
<duostrap-table-cell>Pending</duostrap-table-cell>
<duostrap-table-cell>Bank Transfer</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$200.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv007"
header-kind="row"
>
INV007
</duostrap-table-header-cell>
<duostrap-table-cell>Unpaid</duostrap-table-cell>
<duostrap-table-cell>Credit Card</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$300.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="footer">
<duostrap-table-header-cell
header-key="total"
header-kind="row"
>
Total
</duostrap-table-header-cell>
<duostrap-table-cell></duostrap-table-cell>
<duostrap-table-cell></duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$2,500.00
</duostrap-table-cell>
</duostrap-table-row>
</duostrap-table-root>
</div>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. Import the parts from @proto.ui/prototypes-duostrap/table:
import { tableRoot, tableCaption, tableRow, tableHeaderCell, tableCell,} from '@proto.ui/prototypes-duostrap/table';<div class="w-full overflow-x-auto"> <duostrap-table-root> <duostrap-table-caption>A list of your recent invoices.</duostrap-table-caption> <duostrap-table-row section="header"> <duostrap-table-header-cell header-key="invoice" header-kind="column" style="width: 100px" > Invoice </duostrap-table-header-cell> <duostrap-table-header-cell header-key="status" header-kind="column" >Status</duostrap-table-header-cell > <duostrap-table-header-cell header-key="method" header-kind="column" >Method</duostrap-table-header-cell > <duostrap-table-header-cell header-key="amount" header-kind="column" style="text-align: end" > Amount </duostrap-table-header-cell> </duostrap-table-row> <duostrap-table-row section="body"> <duostrap-table-header-cell header-key="inv001" header-kind="row" >INV001</duostrap-table-header-cell > <duostrap-table-cell>Paid</duostrap-table-cell> <duostrap-table-cell>Credit Card</duostrap-table-cell> <duostrap-table-cell style="text-align: end">$250.00</duostrap-table-cell> </duostrap-table-row> </duostrap-table-root></div>Composition
Section titled “Composition”Root├── Caption├── Row (section="header")│ └── HeaderCell (headerKind="column")├── Row (section="body")│ ├── HeaderCell (headerKind="row")│ └── Cell (headers=[...])└── Row (section="footer") ├── HeaderCell (headerKind="row") └── Cell (headers=[...])- Baseline
.tablestyling omits the top border on first-row column headers and keeps8pxcell padding by default. - Cell dividers bind to the theme
border-bordertoken so both light and dark hosts maintain legible contrast alongsidetext-foreground.
Examples
Section titled “Examples”Footer
Section titled “Footer”Set section="footer" to style summary rows with the secondary surface tint and bold emphasis:
<div class="w-full overflow-x-auto">
<duostrap-table-root>
<duostrap-table-caption>
A list of your recent invoices.
</duostrap-table-caption>
<duostrap-table-row section="header">
<duostrap-table-header-cell
header-key="invoice"
header-kind="column"
style="width: 100px"
>
Invoice
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="status"
header-kind="column"
>
Status
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="method"
header-kind="column"
>
Method
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="amount"
header-kind="column"
style="text-align: end"
>
Amount
</duostrap-table-header-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv001"
header-kind="row"
>
INV001
</duostrap-table-header-cell>
<duostrap-table-cell>Paid</duostrap-table-cell>
<duostrap-table-cell>Credit Card</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$250.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv002"
header-kind="row"
>
INV002
</duostrap-table-header-cell>
<duostrap-table-cell>Pending</duostrap-table-cell>
<duostrap-table-cell>PayPal</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$150.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="inv003"
header-kind="row"
>
INV003
</duostrap-table-header-cell>
<duostrap-table-cell>Unpaid</duostrap-table-cell>
<duostrap-table-cell>Bank Transfer</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$350.00
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row section="footer">
<duostrap-table-header-cell
header-key="total"
header-kind="row"
>
Total
</duostrap-table-header-cell>
<duostrap-table-cell></duostrap-table-cell>
<duostrap-table-cell></duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
$750.00
</duostrap-table-cell>
</duostrap-table-row>
</duostrap-table-root>
</div>Variants & Contextual Rows
Section titled “Variants & Contextual Rows”Combine bordered, condensed (4px 5px cell padding), striped, hoverable, and contextual info / warning / error row tones:
<div class="w-full overflow-x-auto">
<duostrap-table-root bordered>
<duostrap-table-caption>
Service health summary
</duostrap-table-caption>
<duostrap-table-row section="header">
<duostrap-table-header-cell
header-key="service"
header-kind="column"
condensed
>
Service
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="region"
header-kind="column"
condensed
bordered
>
Region
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="status"
header-kind="column"
condensed
bordered
>
Status
</duostrap-table-header-cell>
</duostrap-table-row>
<duostrap-table-row hoverable tone="info">
<duostrap-table-header-cell
header-key="billing"
header-kind="row"
condensed
>
Billing
</duostrap-table-header-cell>
<duostrap-table-cell condensed bordered>
eu-west-1
</duostrap-table-cell>
<duostrap-table-cell condensed bordered>
Maintenance scheduled
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row hoverable tone="warning">
<duostrap-table-header-cell
header-key="webhooks"
header-kind="row"
condensed
>
Webhooks
</duostrap-table-header-cell>
<duostrap-table-cell condensed bordered>
us-west-2
</duostrap-table-cell>
<duostrap-table-cell condensed bordered>
Elevated latency
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row hoverable striped>
<duostrap-table-header-cell
header-key="archive"
header-kind="row"
condensed
>
Cold Archive
</duostrap-table-header-cell>
<duostrap-table-cell condensed bordered>
ap-east-1
</duostrap-table-cell>
<duostrap-table-cell condensed bordered>
Sync retrying
</duostrap-table-cell>
</duostrap-table-row>
<duostrap-table-row hoverable tone="error">
<duostrap-table-header-cell
header-key="smtp"
header-kind="row"
condensed
>
SMTP Relay
</duostrap-table-header-cell>
<duostrap-table-cell condensed bordered>
eu-central-1
</duostrap-table-cell>
<duostrap-table-cell condensed bordered>
Degraded delivery
</duostrap-table-cell>
</duostrap-table-row>
</duostrap-table-root>
</div>Actions
Section titled “Actions”Pair rows with Duostrap DropdownMenu controls in the trailing column:
<div class="w-full overflow-x-auto">
<duostrap-table-root>
<duostrap-table-row section="header">
<duostrap-table-header-cell
header-key="product"
header-kind="column"
>
Product
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="price"
header-kind="column"
>
Price
</duostrap-table-header-cell>
<duostrap-table-header-cell
header-key="actions"
header-kind="column"
style="text-align: end"
>
Actions
</duostrap-table-header-cell>
</duostrap-table-row>
<duostrap-table-row section="body">
<duostrap-table-header-cell
header-key="mouse"
header-kind="row"
>
Wireless Mouse
</duostrap-table-header-cell>
<duostrap-table-cell>$29.99</duostrap-table-cell>
<duostrap-table-cell style="text-align: end">
<duostrap-dropdown-root>
<duostrap-dropdown-trigger>
<span aria-hidden="true">⋯</span>
<span class="sr-only">Open menu</span>
</duostrap-dropdown-trigger>
<duostrap-dropdown-content align="end">
<duostrap-dropdown-item value="edit">
Edit
</duostrap-dropdown-item>
<duostrap-dropdown-item value="duplicate">
Duplicate
</duostrap-dropdown-item>
<duostrap-dropdown-separator></duostrap-dropdown-separator>
<duostrap-dropdown-item value="delete">
Delete
</duostrap-dropdown-item>
</duostrap-dropdown-content>
</duostrap-dropdown-root>
</duostrap-table-cell>
</duostrap-table-row>
</duostrap-table-root>
</div>Root exposes getStructure() for inspecting the live row/column snapshot.
| Prop | Type | Default | Description |
|---|---|---|---|
bordered | boolean | false | Applies the classic .table-bordered outer border and 4px radius |
Caption
Section titled “Caption”Caption declares no props and renders centered muted caption typography.
| Prop | Type | Default | Description |
|---|---|---|---|
section | 'header' 'body' 'footer' | 'body' | Visual section membership; footer applies secondary fill and bold text |
striped | boolean | false | Applies .table-striped alternating secondary shading on body rows |
hoverable | boolean | false | Enables passive .table-hover shading on pointer hover |
tone | 'default' 'info' 'warning' 'error' | 'default' | Classic Duostrap contextual row coloring |
HeaderCell
Section titled “HeaderCell”| Prop | Type | Default | Description |
|---|---|---|---|
headerKey | string | '' | Unique header identifier referenced by Cell.headers |
headerKind | 'column' 'row' | undefined | Column headers align bottom without a first-row top rule; row headers align top |
headers | readonly string[] | [] | Ordered parent header keys for multi-level header groups |
rowSpan | number | 1 | Positive integer accessible row span |
columnSpan | number | 1 | Positive integer accessible column span |
condensed | boolean | false | Applies .table-condensed cell padding (4px 5px) |
bordered | boolean | false | Adds a leading vertical divider for bordered table layouts |
| Prop | Type | Default | Description |
|---|---|---|---|
headers | readonly string[] | [] | Ordered list of headerKey references |
rowSpan | number | 1 | Positive integer accessible row span |
columnSpan | number | 1 | Positive integer accessible column span |
condensed | boolean | false | Applies .table-condensed cell padding (4px 5px) |
bordered | boolean | false | Adds a leading vertical divider for bordered table layouts |