Table
Styles semantic tables for records and comparisons.
- Frameworks
- Astro · React · Elements · Dioxus
- Registry
lumen add Table- Interaction
- Enhanced runtime
See it and copy it
Framework example
Choose Astro, React, Elements, or Dioxus to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.
| Customer | Status | Due | Amount | Actions |
|---|---|---|---|---|
| Paid | Dec 4, 2026 | $1,240.00 | ||
| Sent | Dec 18, 2026 | $860.00 | ||
| Overdue | Nov 28, 2026 | $2,010.00 | ||
| Total | $4,110.00 | |||
View Table code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React, Elements, and Dioxus use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { Avatar, Badge, Button, Icon, Stack, Table, VisuallyHidden } from '@santi020k/lumen-astro'
---
<Table aria-label="Invoices" layout="records" role="region" tabindex="0">
<table role="table">
<thead role="rowgroup">
<tr role="row">
<th class="ui-table__cell--title" role="columnheader" scope="col">Customer</th>
<th role="columnheader" scope="col">Status</th>
<th role="columnheader" scope="col">Due</th>
<th data-numeric="true" role="columnheader" scope="col">Amount</th>
<th role="columnheader" scope="col"><VisuallyHidden>Actions</VisuallyHidden></th>
</tr>
</thead>
<tbody role="rowgroup">
<tr role="row">
<td class="ui-table__cell--title" role="cell">
<Stack align="center" direction="horizontal" gap="sm">
<Avatar aria-hidden="true" fallback="LS" />
<span>
<a class="ui-table__row-link" href="?invoice=1042">Linden Studio</a>
<span class="ui-table__meta">Invoice 1042</span>
</span>
</Stack>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Status</span>
<Badge dot variant="success">Paid</Badge>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Due</span>
Dec 4, 2026
</td>
<td class="ui-table__cell--trailing" data-numeric="true" role="cell">$1,240.00</td>
<td class="ui-table__cell--actions" role="cell">
<Button aria-label="Actions for Linden Studio" size="icon" variant="ghost">
<Icon decorative name="ellipsis" />
</Button>
</td>
</tr>
<tr role="row">
<td class="ui-table__cell--title" role="cell">
<Stack align="center" direction="horizontal" gap="sm">
<Avatar aria-hidden="true" fallback="AB" />
<span>
<a class="ui-table__row-link" href="?invoice=1043">Aster Bakery</a>
<span class="ui-table__meta">Invoice 1043</span>
</span>
</Stack>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Status</span>
<Badge dot variant="info">Sent</Badge>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Due</span>
Dec 18, 2026
</td>
<td class="ui-table__cell--trailing" data-numeric="true" role="cell">$860.00</td>
<td class="ui-table__cell--actions" role="cell">
<Button aria-label="Actions for Aster Bakery" size="icon" variant="ghost">
<Icon decorative name="ellipsis" />
</Button>
</td>
</tr>
<tr role="row">
<td class="ui-table__cell--title" role="cell">
<Stack align="center" direction="horizontal" gap="sm">
<Avatar aria-hidden="true" fallback="CL" />
<span>
<a class="ui-table__row-link" href="?invoice=1044">Cobalt Labs</a>
<span class="ui-table__meta">Invoice 1044</span>
</span>
</Stack>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Status</span>
<Badge dot variant="destructive">Overdue</Badge>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Due</span>
Nov 28, 2026
</td>
<td class="ui-table__cell--trailing" data-numeric="true" role="cell">$2,010.00</td>
<td class="ui-table__cell--actions" role="cell">
<Button aria-label="Actions for Cobalt Labs" size="icon" variant="ghost">
<Icon decorative name="ellipsis" />
</Button>
</td>
</tr>
</tbody>
<tfoot role="rowgroup">
<tr role="row">
<th colspan="3" role="rowheader" scope="row">Total</th>
<td data-numeric="true" role="cell">$4,110.00</td>
<td role="cell"></td>
</tr>
</tfoot>
</table>
</Table>import { Avatar, Badge, Button, Icon, Stack, Table, VisuallyHidden } from '@santi020k/lumen-react'
export const Example = () => (
<>
<Table aria-label="Invoices" layout="records" role="region" tabIndex={0}>
<table role="table">
<thead role="rowgroup">
<tr role="row">
<th className="ui-table__cell--title" role="columnheader" scope="col">Customer</th>
<th role="columnheader" scope="col">Status</th>
<th role="columnheader" scope="col">Due</th>
<th data-numeric="true" role="columnheader" scope="col">Amount</th>
<th role="columnheader" scope="col"><VisuallyHidden>Actions</VisuallyHidden></th>
</tr>
</thead>
<tbody role="rowgroup">
<tr role="row">
<td className="ui-table__cell--title" role="cell">
<Stack align="center" direction="horizontal" gap="sm">
<Avatar aria-hidden="true" fallback="LS" />
<span>
<a className="ui-table__row-link" href="?invoice=1042">Linden Studio</a>
<span className="ui-table__meta">Invoice 1042</span>
</span>
</Stack>
</td>
<td role="cell">
<span className="ui-table__label" aria-hidden="true">Status</span>
<Badge dot variant="success">Paid</Badge>
</td>
<td role="cell">
<span className="ui-table__label" aria-hidden="true">Due</span>
Dec 4, 2026
</td>
<td className="ui-table__cell--trailing" data-numeric="true" role="cell">$1,240.00</td>
<td className="ui-table__cell--actions" role="cell">
<Button aria-label="Actions for Linden Studio" size="icon" variant="ghost">
<Icon decorative name="ellipsis" />
</Button>
</td>
</tr>
<tr role="row">
<td className="ui-table__cell--title" role="cell">
<Stack align="center" direction="horizontal" gap="sm">
<Avatar aria-hidden="true" fallback="AB" />
<span>
<a className="ui-table__row-link" href="?invoice=1043">Aster Bakery</a>
<span className="ui-table__meta">Invoice 1043</span>
</span>
</Stack>
</td>
<td role="cell">
<span className="ui-table__label" aria-hidden="true">Status</span>
<Badge dot variant="info">Sent</Badge>
</td>
<td role="cell">
<span className="ui-table__label" aria-hidden="true">Due</span>
Dec 18, 2026
</td>
<td className="ui-table__cell--trailing" data-numeric="true" role="cell">$860.00</td>
<td className="ui-table__cell--actions" role="cell">
<Button aria-label="Actions for Aster Bakery" size="icon" variant="ghost">
<Icon decorative name="ellipsis" />
</Button>
</td>
</tr>
<tr role="row">
<td className="ui-table__cell--title" role="cell">
<Stack align="center" direction="horizontal" gap="sm">
<Avatar aria-hidden="true" fallback="CL" />
<span>
<a className="ui-table__row-link" href="?invoice=1044">Cobalt Labs</a>
<span className="ui-table__meta">Invoice 1044</span>
</span>
</Stack>
</td>
<td role="cell">
<span className="ui-table__label" aria-hidden="true">Status</span>
<Badge dot variant="destructive">Overdue</Badge>
</td>
<td role="cell">
<span className="ui-table__label" aria-hidden="true">Due</span>
Nov 28, 2026
</td>
<td className="ui-table__cell--trailing" data-numeric="true" role="cell">$2,010.00</td>
<td className="ui-table__cell--actions" role="cell">
<Button aria-label="Actions for Cobalt Labs" size="icon" variant="ghost">
<Icon decorative name="ellipsis" />
</Button>
</td>
</tr>
</tbody>
<tfoot role="rowgroup">
<tr role="row">
<th colSpan={3} role="rowheader" scope="row">Total</th>
<td data-numeric="true" role="cell">$4,110.00</td>
<td role="cell"></td>
</tr>
</tfoot>
</table>
</Table>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-table aria-label="Invoices" layout="records" role="region" tabindex="0">
<table role="table">
<thead role="rowgroup">
<tr role="row">
<th class="ui-table__cell--title" role="columnheader" scope="col">Customer</th>
<th role="columnheader" scope="col">Status</th>
<th role="columnheader" scope="col">Due</th>
<th data-numeric="true" role="columnheader" scope="col">Amount</th>
<th role="columnheader" scope="col"><lumen-visually-hidden>Actions</lumen-visually-hidden></th>
</tr>
</thead>
<tbody role="rowgroup">
<tr role="row">
<td class="ui-table__cell--title" role="cell">
<lumen-stack align="center" direction="horizontal" gap="sm">
<lumen-avatar aria-hidden="true" fallback="LS"></lumen-avatar>
<span>
<a class="ui-table__row-link" href="?invoice=1042">Linden Studio</a>
<span class="ui-table__meta">Invoice 1042</span>
</span>
</lumen-stack>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Status</span>
<lumen-badge dot variant="success">Paid</lumen-badge>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Due</span>
Dec 4, 2026
</td>
<td class="ui-table__cell--trailing" data-numeric="true" role="cell">$1,240.00</td>
<td class="ui-table__cell--actions" role="cell">
<lumen-button aria-label="Actions for Linden Studio" size="icon" variant="ghost">
<lumen-icon decorative name="ellipsis"></lumen-icon>
</lumen-button>
</td>
</tr>
<tr role="row">
<td class="ui-table__cell--title" role="cell">
<lumen-stack align="center" direction="horizontal" gap="sm">
<lumen-avatar aria-hidden="true" fallback="AB"></lumen-avatar>
<span>
<a class="ui-table__row-link" href="?invoice=1043">Aster Bakery</a>
<span class="ui-table__meta">Invoice 1043</span>
</span>
</lumen-stack>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Status</span>
<lumen-badge dot variant="info">Sent</lumen-badge>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Due</span>
Dec 18, 2026
</td>
<td class="ui-table__cell--trailing" data-numeric="true" role="cell">$860.00</td>
<td class="ui-table__cell--actions" role="cell">
<lumen-button aria-label="Actions for Aster Bakery" size="icon" variant="ghost">
<lumen-icon decorative name="ellipsis"></lumen-icon>
</lumen-button>
</td>
</tr>
<tr role="row">
<td class="ui-table__cell--title" role="cell">
<lumen-stack align="center" direction="horizontal" gap="sm">
<lumen-avatar aria-hidden="true" fallback="CL"></lumen-avatar>
<span>
<a class="ui-table__row-link" href="?invoice=1044">Cobalt Labs</a>
<span class="ui-table__meta">Invoice 1044</span>
</span>
</lumen-stack>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Status</span>
<lumen-badge dot variant="destructive">Overdue</lumen-badge>
</td>
<td role="cell">
<span class="ui-table__label" aria-hidden="true">Due</span>
Nov 28, 2026
</td>
<td class="ui-table__cell--trailing" data-numeric="true" role="cell">$2,010.00</td>
<td class="ui-table__cell--actions" role="cell">
<lumen-button aria-label="Actions for Cobalt Labs" size="icon" variant="ghost">
<lumen-icon decorative name="ellipsis"></lumen-icon>
</lumen-button>
</td>
</tr>
</tbody>
<tfoot role="rowgroup">
<tr role="row">
<th colspan="3" role="rowheader" scope="row">Total</th>
<td data-numeric="true" role="cell">$4,110.00</td>
<td role="cell"></td>
</tr>
</tfoot>
</table>
</lumen-table>use dioxus::prelude::*;
use lumen_dioxus::prelude::*;
#[component]
fn Example() -> Element {
rsx! {
Table { scroll_cue: true,
table {
thead { tr { th { scope: "col", "Plan" } th { scope: "col", "Price" } } }
tbody { tr { td { "Pro" } td { "$24" } } }
}
}
}
}Condensed columns
Use layout="condensed" when a narrow table should stay a table. While the table is narrower than 48rem, columns marked ui-table__cell--secondary step aside, and a ui-table__narrow line in the title cell repeats their values. scrollCue adds a hint while the remaining columns still overflow.
| Service | Environment | Region | Status | Duration |
|---|---|---|---|---|
| checkout-api | Production | eu-west-1 | Live | 2m 14s |
| search-indexer | Staging | us-east-1 | Building | 4m 02s |
| billing-worker | Production | us-east-1 | Failed | 0m 48s |
| docs-site | Preview | eu-west-1 | Live | 1m 31s |
View Table code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React and Elements use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { Badge, Table } from '@santi020k/lumen-astro'
---
<Table aria-label="Recent deployments" layout="condensed" scrollCue>
<table>
<thead>
<tr>
<th class="ui-table__cell--title" scope="col">Service</th>
<th class="ui-table__cell--secondary" scope="col">Environment</th>
<th class="ui-table__cell--secondary" scope="col">Region</th>
<th scope="col">Status</th>
<th data-numeric="true" scope="col">Duration</th>
</tr>
</thead>
<tbody>
<tr>
<th class="ui-table__cell--title" scope="row">
checkout-api
<span class="ui-table__meta ui-table__narrow"><span>Production</span><span>eu-west-1</span></span>
</th>
<td class="ui-table__cell--secondary">Production</td>
<td class="ui-table__cell--secondary">eu-west-1</td>
<td><Badge dot variant="success">Live</Badge></td>
<td data-numeric="true">2m 14s</td>
</tr>
<tr>
<th class="ui-table__cell--title" scope="row">
search-indexer
<span class="ui-table__meta ui-table__narrow"><span>Staging</span><span>us-east-1</span></span>
</th>
<td class="ui-table__cell--secondary">Staging</td>
<td class="ui-table__cell--secondary">us-east-1</td>
<td><Badge dot variant="info">Building</Badge></td>
<td data-numeric="true">4m 02s</td>
</tr>
<tr>
<th class="ui-table__cell--title" scope="row">
billing-worker
<span class="ui-table__meta ui-table__narrow"><span>Production</span><span>us-east-1</span></span>
</th>
<td class="ui-table__cell--secondary">Production</td>
<td class="ui-table__cell--secondary">us-east-1</td>
<td><Badge dot variant="destructive">Failed</Badge></td>
<td data-numeric="true">0m 48s</td>
</tr>
<tr>
<th class="ui-table__cell--title" scope="row">
docs-site
<span class="ui-table__meta ui-table__narrow"><span>Preview</span><span>eu-west-1</span></span>
</th>
<td class="ui-table__cell--secondary">Preview</td>
<td class="ui-table__cell--secondary">eu-west-1</td>
<td><Badge dot variant="success">Live</Badge></td>
<td data-numeric="true">1m 31s</td>
</tr>
</tbody>
</table>
</Table>import { Badge, Table } from '@santi020k/lumen-react'
export const Example = () => (
<>
<Table aria-label="Recent deployments" layout="condensed" scrollCue>
<table>
<thead>
<tr>
<th className="ui-table__cell--title" scope="col">Service</th>
<th className="ui-table__cell--secondary" scope="col">Environment</th>
<th className="ui-table__cell--secondary" scope="col">Region</th>
<th scope="col">Status</th>
<th data-numeric="true" scope="col">Duration</th>
</tr>
</thead>
<tbody>
<tr>
<th className="ui-table__cell--title" scope="row">
checkout-api
<span className="ui-table__meta ui-table__narrow"><span>Production</span><span>eu-west-1</span></span>
</th>
<td className="ui-table__cell--secondary">Production</td>
<td className="ui-table__cell--secondary">eu-west-1</td>
<td><Badge dot variant="success">Live</Badge></td>
<td data-numeric="true">2m 14s</td>
</tr>
<tr>
<th className="ui-table__cell--title" scope="row">
search-indexer
<span className="ui-table__meta ui-table__narrow"><span>Staging</span><span>us-east-1</span></span>
</th>
<td className="ui-table__cell--secondary">Staging</td>
<td className="ui-table__cell--secondary">us-east-1</td>
<td><Badge dot variant="info">Building</Badge></td>
<td data-numeric="true">4m 02s</td>
</tr>
<tr>
<th className="ui-table__cell--title" scope="row">
billing-worker
<span className="ui-table__meta ui-table__narrow"><span>Production</span><span>us-east-1</span></span>
</th>
<td className="ui-table__cell--secondary">Production</td>
<td className="ui-table__cell--secondary">us-east-1</td>
<td><Badge dot variant="destructive">Failed</Badge></td>
<td data-numeric="true">0m 48s</td>
</tr>
<tr>
<th className="ui-table__cell--title" scope="row">
docs-site
<span className="ui-table__meta ui-table__narrow"><span>Preview</span><span>eu-west-1</span></span>
</th>
<td className="ui-table__cell--secondary">Preview</td>
<td className="ui-table__cell--secondary">eu-west-1</td>
<td><Badge dot variant="success">Live</Badge></td>
<td data-numeric="true">1m 31s</td>
</tr>
</tbody>
</table>
</Table>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-table aria-label="Recent deployments" layout="condensed" scroll-cue>
<table>
<thead>
<tr>
<th class="ui-table__cell--title" scope="col">Service</th>
<th class="ui-table__cell--secondary" scope="col">Environment</th>
<th class="ui-table__cell--secondary" scope="col">Region</th>
<th scope="col">Status</th>
<th data-numeric="true" scope="col">Duration</th>
</tr>
</thead>
<tbody>
<tr>
<th class="ui-table__cell--title" scope="row">
checkout-api
<span class="ui-table__meta ui-table__narrow"><span>Production</span><span>eu-west-1</span></span>
</th>
<td class="ui-table__cell--secondary">Production</td>
<td class="ui-table__cell--secondary">eu-west-1</td>
<td><lumen-badge dot variant="success">Live</lumen-badge></td>
<td data-numeric="true">2m 14s</td>
</tr>
<tr>
<th class="ui-table__cell--title" scope="row">
search-indexer
<span class="ui-table__meta ui-table__narrow"><span>Staging</span><span>us-east-1</span></span>
</th>
<td class="ui-table__cell--secondary">Staging</td>
<td class="ui-table__cell--secondary">us-east-1</td>
<td><lumen-badge dot variant="info">Building</lumen-badge></td>
<td data-numeric="true">4m 02s</td>
</tr>
<tr>
<th class="ui-table__cell--title" scope="row">
billing-worker
<span class="ui-table__meta ui-table__narrow"><span>Production</span><span>us-east-1</span></span>
</th>
<td class="ui-table__cell--secondary">Production</td>
<td class="ui-table__cell--secondary">us-east-1</td>
<td><lumen-badge dot variant="destructive">Failed</lumen-badge></td>
<td data-numeric="true">0m 48s</td>
</tr>
<tr>
<th class="ui-table__cell--title" scope="row">
docs-site
<span class="ui-table__meta ui-table__narrow"><span>Preview</span><span>eu-west-1</span></span>
</th>
<td class="ui-table__cell--secondary">Preview</td>
<td class="ui-table__cell--secondary">eu-west-1</td>
<td><lumen-badge dot variant="success">Live</lumen-badge></td>
<td data-numeric="true">1m 31s</td>
</tr>
</tbody>
</table>
</lumen-table>Sticky header and totals
stickyHeader keeps column names in view while rows scroll inside the table, up to --ui-table-max-height (32rem by default). data-numeric="true" end-aligns a column with tabular figures, tfoot rows read as totals, and aria-sort on a header shows the order you applied.
| Month | Orders | Revenue | Refunds | Net |
|---|---|---|---|---|
| January | 412 | $18,540 | $620 | $17,920 |
| February | 388 | $17,460 | $540 | $16,920 |
| March | 455 | $20,475 | $710 | $19,765 |
| April | 430 | $19,350 | $480 | $18,870 |
| May | 472 | $21,240 | $690 | $20,550 |
| June | 498 | $22,410 | $830 | $21,580 |
| July | 520 | $23,400 | $760 | $22,640 |
| August | 505 | $22,725 | $650 | $22,075 |
| September | 468 | $21,060 | $590 | $20,470 |
| October | 491 | $22,095 | $720 | $21,375 |
| November | 563 | $25,335 | $940 | $24,395 |
| December | 612 | $27,540 | $1,080 | $26,460 |
| Year | 5,814 | $261,630 | $8,610 | $253,020 |
View Table code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React and Elements use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { Table } from '@santi020k/lumen-astro'
---
<Table
aria-label="Monthly orders"
role="region"
stickyFirstColumn
stickyHeader
style="--ui-table-max-height: 18rem"
tabindex="0"
>
<table>
<caption>Fictional figures for an example store.</caption>
<thead>
<tr>
<th aria-sort="ascending" scope="col">Month</th>
<th data-numeric="true" scope="col">Orders</th>
<th data-numeric="true" scope="col">Revenue</th>
<th data-numeric="true" scope="col">Refunds</th>
<th data-numeric="true" scope="col">Net</th>
</tr>
</thead>
<tbody>
<tr><th scope="row">January</th><td data-numeric="true">412</td><td data-numeric="true">$18,540</td><td data-numeric="true">$620</td><td data-numeric="true">$17,920</td></tr>
<tr><th scope="row">February</th><td data-numeric="true">388</td><td data-numeric="true">$17,460</td><td data-numeric="true">$540</td><td data-numeric="true">$16,920</td></tr>
<tr><th scope="row">March</th><td data-numeric="true">455</td><td data-numeric="true">$20,475</td><td data-numeric="true">$710</td><td data-numeric="true">$19,765</td></tr>
<tr><th scope="row">April</th><td data-numeric="true">430</td><td data-numeric="true">$19,350</td><td data-numeric="true">$480</td><td data-numeric="true">$18,870</td></tr>
<tr><th scope="row">May</th><td data-numeric="true">472</td><td data-numeric="true">$21,240</td><td data-numeric="true">$690</td><td data-numeric="true">$20,550</td></tr>
<tr><th scope="row">June</th><td data-numeric="true">498</td><td data-numeric="true">$22,410</td><td data-numeric="true">$830</td><td data-numeric="true">$21,580</td></tr>
<tr><th scope="row">July</th><td data-numeric="true">520</td><td data-numeric="true">$23,400</td><td data-numeric="true">$760</td><td data-numeric="true">$22,640</td></tr>
<tr><th scope="row">August</th><td data-numeric="true">505</td><td data-numeric="true">$22,725</td><td data-numeric="true">$650</td><td data-numeric="true">$22,075</td></tr>
<tr><th scope="row">September</th><td data-numeric="true">468</td><td data-numeric="true">$21,060</td><td data-numeric="true">$590</td><td data-numeric="true">$20,470</td></tr>
<tr><th scope="row">October</th><td data-numeric="true">491</td><td data-numeric="true">$22,095</td><td data-numeric="true">$720</td><td data-numeric="true">$21,375</td></tr>
<tr><th scope="row">November</th><td data-numeric="true">563</td><td data-numeric="true">$25,335</td><td data-numeric="true">$940</td><td data-numeric="true">$24,395</td></tr>
<tr><th scope="row">December</th><td data-numeric="true">612</td><td data-numeric="true">$27,540</td><td data-numeric="true">$1,080</td><td data-numeric="true">$26,460</td></tr>
</tbody>
<tfoot>
<tr><th scope="row">Year</th><td data-numeric="true">5,814</td><td data-numeric="true">$261,630</td><td data-numeric="true">$8,610</td><td data-numeric="true">$253,020</td></tr>
</tfoot>
</table>
</Table>import type { CSSProperties } from 'react'
import { Table } from '@santi020k/lumen-react'
const exampleStyle0: CSSProperties & Record<`--${string}`, string | number> = { "--ui-table-max-height": "18rem" }
export const Example = () => (
<>
<Table
aria-label="Monthly orders"
role="region"
stickyFirstColumn
stickyHeader
style={exampleStyle0}
tabIndex={0}
>
<table>
<caption>Fictional figures for an example store.</caption>
<thead>
<tr>
<th aria-sort="ascending" scope="col">Month</th>
<th data-numeric="true" scope="col">Orders</th>
<th data-numeric="true" scope="col">Revenue</th>
<th data-numeric="true" scope="col">Refunds</th>
<th data-numeric="true" scope="col">Net</th>
</tr>
</thead>
<tbody>
<tr><th scope="row">January</th><td data-numeric="true">412</td><td data-numeric="true">$18,540</td><td data-numeric="true">$620</td><td data-numeric="true">$17,920</td></tr>
<tr><th scope="row">February</th><td data-numeric="true">388</td><td data-numeric="true">$17,460</td><td data-numeric="true">$540</td><td data-numeric="true">$16,920</td></tr>
<tr><th scope="row">March</th><td data-numeric="true">455</td><td data-numeric="true">$20,475</td><td data-numeric="true">$710</td><td data-numeric="true">$19,765</td></tr>
<tr><th scope="row">April</th><td data-numeric="true">430</td><td data-numeric="true">$19,350</td><td data-numeric="true">$480</td><td data-numeric="true">$18,870</td></tr>
<tr><th scope="row">May</th><td data-numeric="true">472</td><td data-numeric="true">$21,240</td><td data-numeric="true">$690</td><td data-numeric="true">$20,550</td></tr>
<tr><th scope="row">June</th><td data-numeric="true">498</td><td data-numeric="true">$22,410</td><td data-numeric="true">$830</td><td data-numeric="true">$21,580</td></tr>
<tr><th scope="row">July</th><td data-numeric="true">520</td><td data-numeric="true">$23,400</td><td data-numeric="true">$760</td><td data-numeric="true">$22,640</td></tr>
<tr><th scope="row">August</th><td data-numeric="true">505</td><td data-numeric="true">$22,725</td><td data-numeric="true">$650</td><td data-numeric="true">$22,075</td></tr>
<tr><th scope="row">September</th><td data-numeric="true">468</td><td data-numeric="true">$21,060</td><td data-numeric="true">$590</td><td data-numeric="true">$20,470</td></tr>
<tr><th scope="row">October</th><td data-numeric="true">491</td><td data-numeric="true">$22,095</td><td data-numeric="true">$720</td><td data-numeric="true">$21,375</td></tr>
<tr><th scope="row">November</th><td data-numeric="true">563</td><td data-numeric="true">$25,335</td><td data-numeric="true">$940</td><td data-numeric="true">$24,395</td></tr>
<tr><th scope="row">December</th><td data-numeric="true">612</td><td data-numeric="true">$27,540</td><td data-numeric="true">$1,080</td><td data-numeric="true">$26,460</td></tr>
</tbody>
<tfoot>
<tr><th scope="row">Year</th><td data-numeric="true">5,814</td><td data-numeric="true">$261,630</td><td data-numeric="true">$8,610</td><td data-numeric="true">$253,020</td></tr>
</tfoot>
</table>
</Table>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-table
aria-label="Monthly orders"
role="region"
sticky-first-column
sticky-header
style="--ui-table-max-height: 18rem"
tabindex="0">
<table>
<caption>Fictional figures for an example store.</caption>
<thead>
<tr>
<th aria-sort="ascending" scope="col">Month</th>
<th data-numeric="true" scope="col">Orders</th>
<th data-numeric="true" scope="col">Revenue</th>
<th data-numeric="true" scope="col">Refunds</th>
<th data-numeric="true" scope="col">Net</th>
</tr>
</thead>
<tbody>
<tr><th scope="row">January</th><td data-numeric="true">412</td><td data-numeric="true">$18,540</td><td data-numeric="true">$620</td><td data-numeric="true">$17,920</td></tr>
<tr><th scope="row">February</th><td data-numeric="true">388</td><td data-numeric="true">$17,460</td><td data-numeric="true">$540</td><td data-numeric="true">$16,920</td></tr>
<tr><th scope="row">March</th><td data-numeric="true">455</td><td data-numeric="true">$20,475</td><td data-numeric="true">$710</td><td data-numeric="true">$19,765</td></tr>
<tr><th scope="row">April</th><td data-numeric="true">430</td><td data-numeric="true">$19,350</td><td data-numeric="true">$480</td><td data-numeric="true">$18,870</td></tr>
<tr><th scope="row">May</th><td data-numeric="true">472</td><td data-numeric="true">$21,240</td><td data-numeric="true">$690</td><td data-numeric="true">$20,550</td></tr>
<tr><th scope="row">June</th><td data-numeric="true">498</td><td data-numeric="true">$22,410</td><td data-numeric="true">$830</td><td data-numeric="true">$21,580</td></tr>
<tr><th scope="row">July</th><td data-numeric="true">520</td><td data-numeric="true">$23,400</td><td data-numeric="true">$760</td><td data-numeric="true">$22,640</td></tr>
<tr><th scope="row">August</th><td data-numeric="true">505</td><td data-numeric="true">$22,725</td><td data-numeric="true">$650</td><td data-numeric="true">$22,075</td></tr>
<tr><th scope="row">September</th><td data-numeric="true">468</td><td data-numeric="true">$21,060</td><td data-numeric="true">$590</td><td data-numeric="true">$20,470</td></tr>
<tr><th scope="row">October</th><td data-numeric="true">491</td><td data-numeric="true">$22,095</td><td data-numeric="true">$720</td><td data-numeric="true">$21,375</td></tr>
<tr><th scope="row">November</th><td data-numeric="true">563</td><td data-numeric="true">$25,335</td><td data-numeric="true">$940</td><td data-numeric="true">$24,395</td></tr>
<tr><th scope="row">December</th><td data-numeric="true">612</td><td data-numeric="true">$27,540</td><td data-numeric="true">$1,080</td><td data-numeric="true">$26,460</td></tr>
</tbody>
<tfoot>
<tr><th scope="row">Year</th><td data-numeric="true">5,814</td><td data-numeric="true">$261,630</td><td data-numeric="true">$8,610</td><td data-numeric="true">$253,020</td></tr>
</tfoot>
</table>
</lumen-table>Choose your target
Add this component
Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.
pnpm add @santi020k/lumen-astrolumen add Tablepnpm add @santi020k/lumen-reactlumen add Table --target reactpnpm add @santi020k/lumen-elementslumen add Table --target elementsGlass
Add the glass prop to apply the shared blur, saturation, border, and highlight tokens. Glass reads best over vivid content, so place the surface above imagery or color.
| Component | Status |
|---|---|
| Table | Glass |
| DataTable | Glass |
| TreeGrid | Glass |
View Table code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React and Elements use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { Table } from '@santi020k/lumen-astro'
---
<div class="docs-glass-demo">
<Table glass>
<table>
<thead><tr><th>Component</th><th>Status</th></tr></thead>
<tbody>
<tr><td>Table</td><td>Glass</td></tr>
<tr><td>DataTable</td><td>Glass</td></tr>
<tr><td>TreeGrid</td><td>Glass</td></tr>
</tbody>
</table>
</Table>
</div>import { Table } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div className="docs-glass-demo">
<Table glass>
<table>
<thead><tr><th>Component</th><th>Status</th></tr></thead>
<tbody>
<tr><td>Table</td><td>Glass</td></tr>
<tr><td>DataTable</td><td>Glass</td></tr>
<tr><td>TreeGrid</td><td>Glass</td></tr>
</tbody>
</table>
</Table>
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div class="docs-glass-demo">
<lumen-table glass>
<table>
<thead><tr><th>Component</th><th>Status</th></tr></thead>
<tbody>
<tr><td>Table</td><td>Glass</td></tr>
<tr><td>DataTable</td><td>Glass</td></tr>
<tr><td>TreeGrid</td><td>Glass</td></tr>
</tbody>
</table>
</lumen-table>
</div>API reference
Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
| Attribute | Values | Default | Description |
|---|---|---|---|
| glass | boolean | "subtle" | "strong" | false | Applies the tokenized liquid-glass surface treatment with backdrop-filter fallbacks; "subtle" and "strong" adjust the fill intensity. |
| layout | "scroll" | "records" | "condensed" | "scroll" | scroll keeps every column and scrolls sideways. records stacks rows into cards, and condensed keeps a table but hides secondary columns, both while the table itself is narrower than 48rem, whatever the viewport. Both read the table's width through a container query, so a table in a shrink-to-fit parent, such as inline-grid or width: max-content, needs a definite width. The stacked records display drops native table semantics, so a records Table restores them: it adds role="table", "rowgroup", "row", "columnheader", "rowheader" and "cell" where none is written, and copies each column header's text into body cells' data-label, which the records CSS shows as the label (colspan and rowspan respected). React and Elements apply this on mount; Astro applies it through the UIPrimitives runtime. Hand-written roles, data-label values and ui-table__label spans are kept; data-label="" hides a cell's label. Dioxus Table still needs roles and label spans written by hand. |
| stickyHeader / sticky-header | boolean | false; true in a React or Dioxus DataTableView | Keeps the header row visible while rows scroll inside the table. The table scrolls vertically once it reaches --ui-table-max-height, so the wrapper becomes a focusable region named "Table" unless you set role, tabindex, aria-label or aria-labelledby. On viewports 40rem wide or narrower (48rem for a records table), and in print, the cap is dropped and the page scrolls instead. A records table that stacks inside a narrow container on a wider screen keeps the cap, because a container cannot query its own width. |
| --ui-table-max-height | CSS length | 32rem | Caps the height of a stickyHeader table. Set it with style or a class on the Table. |
| stickyFirstColumn / sticky-first-column | boolean | false | Keeps row identifiers visible during horizontal scrolling. Uses logical positioning for RTL and releases the column in very narrow containers, records layouts, and print. With stickyHeader, the corner header cell stays above both. |
| scrollCue / scroll-cue | boolean | string | false | With the scroll and condensed layouts, shows "Scroll horizontally to compare" above the table while it overflows sideways, and makes the wrapper a focusable region named "Table" unless you name it. A string replaces the hint. |
| ui-table__cell--title, --trailing, --actions, --meta, --wide | class on th or td | - | Places a column in a stacked records card. title names the record on the first line; without one, a row header is the title. trailing ends that line with an emphasized value, actions holds row controls at its end, meta becomes a muted full-width line under it, and wide takes a full line with its label. Title, trailing, actions and meta cells show no label. In a wide table, title cells read in ink and actions hug the row end. |
| ui-table__cell--secondary, ui-table__narrow | class on th and td; class in a cell | - | Mark every cell of a column secondary to hide it while a records or condensed table is narrow. Repeat its value in the title cell inside <span class="ui-table__meta ui-table__narrow">, which only shows while narrow, so the value stays readable. |
| ui-table__meta | class on an element in a cell | - | A muted second line, such as an email address under a name. Child spans read as one list with a dot between them. |
| ui-table__row-link | class on the a in the title cell | - | Makes the whole row open the link, while buttons, inputs and other links in the row stay clickable. Use one row link per row and give it the record name as its text. With stickyFirstColumn the pinned cell contains the link, so only the title cell opens it. |
| data-numeric="true" | th and td attribute | - | End-aligns a numeric column's header and cells with tabular figures. Set it on the th and every td of the column. |
| aria-sort | "ascending" | "descending" on a th | - | Shows an arrow beside the header text of the column you sorted. The application sorts the rows; DataTable sorts for you. |
| ui-table__empty, ui-table__skeleton-row, aria-busy | classes and wrapper attribute | - | Loading and empty rows for an authored table: aria-busy="true" on the wrapper dims rows already shown, rows of class ui-table__skeleton-row in a tbody with aria-hidden="true" hold a text Skeleton per cell, and one cell of class ui-table__empty with a colspan of the column count holds the empty message. DataTable renders both from loading and empty props. |
| children | caption, thead, tbody, and tfoot | required | Native table structure inside the styled wrapper. The caption reads as a muted note under the rows, and tfoot rows read as totals under a full divider. Header cells sit on a subtle tint. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |
Customize Table
Start with semantic theme tokens and a class on the public component. Keep its accessible name, focus treatment, and interaction state intact.
.product-table {
--surface: 0 0% 100%;
--ink: 220 20% 15%;
--line: 220 15% 82%;
}Apply product-table through Astro's class, React's className, or the custom element's class. Verify foreground and background contrast in both schemes.
| Hook | Values | Default | Contract |
|---|---|---|---|
| data-numeric="true" | th and td attribute | - | End-aligns a numeric column's header and cells with tabular figures. Set it on the th and every td of the column. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
Use the documented hooks above and adapter types when targeting component states. Theme guide · Accessibility verification scope