Data table
Records in columns inside a named region that scrolls sideways: a directory of people, guests, stations, or rows of an imported file, with selection, sorting, and row actions.
When to use
- Records that people compare across the same columns: the admin directory, guest lists, scans, the rows of an imported file (D-CSN-34).
- When people select several records for one action (the bulk bar), sort by a column, or open one record.
- Admin consoles and organizer tools, on a desk; on phones the region scrolls sideways and keeps every column (canonical §10.13).
When not to use
| Situation | Use instead |
|---|---|
| Member-facing data on a phone | List rows, or key–value cards (one outlined card per record) |
| Facts about one record | Key–value rows |
| Fewer than three columns, or items people do not compare | List |
| Layout of a page | CSS grid, never a <table> |
| A chart of the same numbers | A chart on surface or card-outlined-container (canonical §2.11) |
Anatomy
- Bulk bar
.oa-bulk-bar(above the region): a filledcheck_boxicon, the count in a live region, small text buttons. - Region
.oa-table-region: the outlined container, focusable and named, that scrolls sideways. - Table
.oa-table: never narrower than the sum of its columns (--oa-table-min-width). - Header row: 56px,
label-mdinon-surface-variant; a sortable header holds a full-height.oa-table__sortbutton. - Selection column
.oa-table__select: a 48px round target (<label>) around the 20px checkbox; in the header, "Select all people shown". - Row header
<th scope="row">: the one link of the row,.oa-table__entrywith an optional 40px avatar and the record link.oa-title-link.oa-table__link(name, and a second line.oa-table__sub). - Cells:
body-md; numbers.oa-table__num; IDs.oa-table__id; status and person type as status chips; an empty value as.oa-table__empty"—" plus hidden words. - Row actions
.oa-table__actions: a 48pxmore_verticon button opening an action menu. - Pagination below the region:
.oa-pagination(Pagination).
Variants
| Variant | Class | Use for | Key tokens |
|---|---|---|---|
| Comfortable (default) | oa-table |
Rows with an avatar or two lines | --size-table-row 64px |
| Compact | oa-table oa-table--compact |
One-line rows in consoles, from 768px | --size-menu-item 48px |
| Selectable | first column .oa-table__select + .oa-bulk-bar |
Acting on several records | --color-primary-container at 30% on ticked rows |
| Sortable | .oa-table__sort in a header, aria-sort on its th |
Columns people order | --opacity-state-hover, --size-icon-sm |
Density never changes the spacing scale, the 48px targets, or the gutters; compact is for consoles from md only (canonical §4.11, D-LAY-18).
Sizes
| Size | Height | Padding | Type style | Icon size |
|---|---|---|---|---|
| Header row | 56px (--size-table-header) |
inline 12px; no block padding | label-md 14/20 600 |
sort arrow 18px (icon-sm) |
| Comfortable row | 64px (--size-table-row), its 1px rule included |
12px inline, 8px block; 0 block in cells that hold a 48px control, which sits centered 8px from the row's edges | body-md 14/20; record link label-md; IDs code-sm |
40px avatar; 24px in the 48px icon button |
| Compact row | 48px (--size-menu-item), its 1px rule included; 49px when it holds the 48px box or icon button (the target wins, canonical §4.11) |
12px inline, 8px block; 0 block in cells that hold a 48px control | as comfortable; the record link is its 24px line with a 48px ::after target |
as comfortable |
| Selection column | 64px wide | 8px inline | — | 20px checkbox in a 48px target |
| Bulk bar | its content's (about 56px) | 8px block, 20px start, 8px end | count label-md; buttons sm (label-md) |
check_box 24px |
Tokens
| Part | Property | Token |
|---|---|---|
| Region | background, edge, corner | --color-card-outlined-container, 1px --color-outline-variant, --radius-box |
| Header cells | height, type, color | --size-table-header, --text-label-md, --color-on-surface-variant |
| Body rows | height | --size-table-row; compact --size-menu-item |
| Cells | padding | --space-3 inline, --space-2 block (none in the selection, row-header, and row-action cells) |
| Cells | rule above each row | 1px --color-outline-variant |
| Cells | type, color | --text-body-md, --color-on-surface |
| Record link | type, target | --text-label-md, --size-touch-target least height |
| Second line, empty value | color | --color-on-surface-variant |
| IDs and codes | family, type | --font-mono, --text-code-sm |
| Selection target | size, corner, layer | --size-touch-target, --radius-full, --opacity-state-hover / --opacity-state-pressed |
| Ticked row | background | --color-primary-container at 30% (bg-primary-container/30) |
| Sort button | layer, ring | --opacity-state-hover / --opacity-state-pressed, --size-focus-inset |
| Bulk bar | background, text, corner | --color-primary-container, --color-on-primary-container, --radius-box |
| Bulk bar | padding, gaps | --space-2, --space-5; --space-3 between parts |
States
| State | What changes |
|---|---|
| Enabled | Rows are not clickable and have no hover fill (D-CSN-34). |
| Region focus-visible | The family ring around the region (it takes focus so a keyboard can scroll it). |
| Record link hover | The title link underlines (Link). |
| Record link focus-visible | The family ring around the link (8px corners). |
| Selection target hover / pressed | 8% / 12% layer of on-surface-variant on the 48px circle. |
| Checkbox focus-visible | The family ring 2px outside the drawn 20px box. |
| Ticked row | primary-container at 30% behind the row; its text keeps 8.64:1 or more (canonical §2.13). |
| Header box, some rows ticked | Indeterminate (a bar in the box), set by script (input.indeterminate = true). |
| Sortable header hover / focus | 8% layer; the arrow appears; the ring is drawn inset (−4px). |
| Compact row, control focus-visible | The row-action button fills the row, so it draws the ring inset (−4px): the scrolling region would clip a ring outside it. The record link's ring goes around its words (8px corners), inside the row. |
| Sorted column | aria-sort="ascending" or "descending" on its th; the arrow (arrow_upward / arrow_downward) stays. |
| Bulk bar, nothing ticked | The bar is visually hidden, its actions leave the page, and it has no name (no aria-label, so it is not listed as a region); its count stays in the DOM, empty. |
| Loading | Five skeleton rows at the current density; the region aria-busy="true" with one hidden "Loading people…". |
| Empty | The in-content empty state inside the region ("No people match these filters"). |
| Disabled | Not used on rows; a row whose record cannot open shows its name as plain text. |
Behavior
- One link per row. The record link sits in the row header (
th scope="row"), at least 48px tall and 48px wide, however short the name; in a one-line compact row it is its 24px line, with an::afterthat extends its target to 48px (canonical §4.6). The row itself is never a link (D-CSN-34). - Scrolling. The region scrolls sideways when the table is wider than the screen, with
overscroll-behavior-x: contain, so a swipe that reaches the table's edge is not taken as the browser's back gesture; set--oa-table-min-widthto the sum of the columns (Global ID's directory: 65rem). Headers and IDs never wrap; neither do the name and its second line. The table never squeezes (canonical §10.13). - Selection. Ticking a row tints it. The header box ticks every row shown, or clears them; it shows the indeterminate state when some are ticked. The selection is for the rows shown: new results clear it.
- Bulk bar. It sits above the region, present from page load with an empty live count and no name; when a row is ticked, script writes the count ("2 selected") and sets
aria-label="People selected"on the bar, and the bar appears; when the last box is cleared, script empties the count and removes the name, as Global ID's directory does. Leave nothing inside the empty count, not even a space or a line break: the bar hides itself while its count is empty (the CSS:emptytest). It offers small text buttons ("Copy emails", "Clear"). Results of its actions come back in a snackbar ("Copied 2 email addresses"). - Sorting (M3 default). Pressing a sortable header sorts ascending, pressing again descending; move
aria-sortto the sortedthand remove it from the others. - Row actions. "More actions for {name}" opens an APG action menu under the button, aligned to its inline end.
- Pagination hand-off. Below the region,
.oa-pagination(c-nav-site's): "Showing {from}–{to} of {total}", then 48px previous and next circles around "Page {page} of {pages}"; an unavailable direction is aspanwitharia-disabled="true"(Pagination, D-CSN-18). Member-facing lists use "Show {count} more" instead (List). - Phones. Admin tables keep their columns and scroll in the region; member data becomes list rows or key–value cards.
- Motion. Only state layers fade (
duration-short-3); nothing moves.
Pagination below the directory (markup from site-nav.html):
<nav class="oa-pagination" aria-label="Pagination">
<p class="oa-pagination__status">Showing 1–25 of 48</p>
<div class="oa-pagination__controls">
<span class="oa-pagination__btn" aria-disabled="true"><span class="oa-icon oa-icon--mirror" aria-hidden="true" translate="no">chevron_left</span><span class="oa-visually-hidden">Previous page</span></span>
<span class="oa-pagination__page">Page 1 of 2</span>
<a class="oa-pagination__btn" href="#people-page-2" aria-label="Next page"><span class="oa-icon oa-icon--mirror" aria-hidden="true" translate="no">chevron_right</span></a>
</div>
</nav>Accessibility
- Elements. A real
<table>with<thead>,<tbody>,th scope="col"headers, and oneth scope="row"per row. Neverdisplay: blockon table parts (it removes the table semantics; Tamakkan's crew tables today). - Names. The region is a
sectionwitharia-label(oraria-labelledbythe visible heading) andtabindex="0"; the table carries the same name ("All people"). Checkboxes are named per row ("Select Layla Haddad"; header "Select all people shown"); row-action buttons per row ("More actions for Layla Haddad"). - Keyboard. Tab reaches the region (arrow keys scroll it), then the links, boxes, and buttons inside in DOM order; sort buttons take Enter and Space.
- Live region. The bulk bar's count is
aria-live="polite"and exists, empty, from page load: a live region that arrives with its text is not announced. - Empty values. "—" is
aria-hidden; visually hidden words say what is missing ("No unit", "No sign-in recorded"). - Targets. Checkboxes are 48px targets; links are at least 48px tall; icon buttons 48px.
- Contrast. Header text
on-surface-variant9.33:1 (light) and 10.87:1 (dark) on the region; ticked rows keep text at 8.64:1 or more. - Status. Status and person type are chips with an icon and words, never color alone.
- Forced colors. The region's edge and the cell rules stay; the drawn checkbox switches to system colors.
RTL and languages
- The table follows the page direction: the selection column sits at the right in Arabic, row actions at the left; logical padding throughout.
- IDs sit in
<bdi dir="ltr" translate="no">inside a cell aligned to the inline start, so they line up with their header in both directions; emails in the second line sit in<bdi dir="ltr">in Arabic (canonical §14.2). - Sort arrows point up and down and never mirror; pagination chevrons mirror (Pagination).
- Arabic headers from Global ID: "الاسم", "النوع", "رقم Global ID" (with the product name in
<bdi lang="en" translate="no">), "الحالة", "آخر تسجيل دخول"; statuses "نشط", "مدعو"; the select box "تحديد ليلى حداد". - French headers run longer ("Dernière connexion"): they never wrap; the region scrolls.
Content
- Headers: sentence case nouns, no full stop: "Name", "Type", "Unit", "Global ID", "Status", "Last sign-in"; French "Nom", "Type", "Unité", "Global ID", "Statut", "Dernière connexion".
- Cells: the value, in the column's format: dates compact ("27 Oct 2026") or relative within 7 days ("Today 08:42", "Yesterday"); numbers with Western digits and
Intlgrouping; money with its ISO code (canonical §14.3). - Empty: "—" with hidden words that name the missing thing: "No unit", "No sign-in recorded", "No email yet".
- Bulk bar: "{count} selected" / "تم تحديد شخصين" for two (ICU plurals: one, two, few, many, other) / "{count} sélectionnées"; actions "Copy emails" / "نسخ عناوين البريد" / "Copier les e-mails" and "Clear" / "مسح" / "Effacer" (Global ID).
- Region name: the list's name, not "Table" ("All people", "Rows of the file").
- Empty state: "No people match these filters" · "Try another type, unit, or status, or check the spelling of the name." · "Clear filters".
Do and don't
| Do | Don't |
|---|---|
| Put the one link in the row header. | Make the whole row clickable or add a row hover fill. |
| Let the region scroll sideways on phones. | Squeeze columns until names break, or turn cells into blocks. |
| Keep the bulk bar's live count in the page from load. | Mount the live region with its text already in it. |
| Write headers in sentence case at 14px. | Use 11–12px uppercase headers (Games, Tamakkan today). |
| Show "—" with hidden words for an empty value. | Leave a cell blank or write "N/A". |
Tint a ticked row with primary-container at 30%. |
Add a selected-row token or a hex. |
Code
HTML (reference CSS)
The directory, with a ticked selection, the bulk bar, sorting, and row actions. The checkboxes are the family's drawn box (.oa-check__input, Checkbox and radio):
<div class="oa-stack">
<section class="oa-bulk-bar" aria-label="People selected">
<span class="oa-icon oa-icon--filled oa-bulk-bar__icon" aria-hidden="true" translate="no">check_box</span>
<p class="oa-bulk-bar__count" aria-live="polite">2 selected</p>
<div class="oa-bulk-bar__actions">
<button class="oa-btn oa-btn--text oa-btn--sm" type="button"><span class="oa-icon oa-btn__icon" aria-hidden="true" translate="no">content_copy</span><span class="oa-btn__label">Copy emails</span></button>
<button class="oa-btn oa-btn--text oa-btn--sm" type="button"><span class="oa-icon oa-btn__icon" aria-hidden="true" translate="no">close</span><span class="oa-btn__label">Clear</span></button>
</div>
</section>
<section class="oa-table-region" aria-label="All people" tabindex="0">
<table class="oa-table" aria-label="All people" style="--oa-table-min-width: 65rem">
<thead>
<tr>
<th class="oa-table__select" scope="col"><label><input class="oa-check__input" type="checkbox" aria-label="Select all people shown"></label></th>
<th scope="col" aria-sort="ascending"><button class="oa-table__sort" type="button">Name<span class="oa-icon" aria-hidden="true" translate="no">arrow_upward</span></button></th>
<th scope="col">Type</th>
<th scope="col">Unit</th>
<th scope="col">Global ID</th>
<th scope="col"><button class="oa-table__sort" type="button">Status<span class="oa-icon" aria-hidden="true" translate="no">arrow_upward</span></button></th>
<th scope="col">Last sign-in</th>
<th class="oa-table__actions" scope="col"><span class="oa-visually-hidden">Actions</span></th>
</tr>
</thead>
<tbody>
<tr>
<td class="oa-table__select"><label><input class="oa-check__input" type="checkbox" checked aria-label="Select Layla Haddad"></label></td>
<th scope="row">
<div class="oa-table__entry">
<span class="oa-avatar" aria-hidden="true">LH</span>
<a class="oa-title-link oa-table__link" href="#ct-person-layla">Layla Haddad<span class="oa-table__sub">layla.haddad@example.com</span></a>
</div>
</th>
<td><span class="oa-status-chip oa-status-chip--cat-orange"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">school</span>Student</span></td>
<td>Faculty of Engineering</td>
<td class="oa-table__id"><bdi dir="ltr" translate="no">GU-25-000123</bdi></td>
<td><span class="oa-status-chip oa-status-chip--success"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">check_circle</span>Active</span></td>
<td>Today 08:42</td>
<td class="oa-table__actions"><button class="oa-icon-btn" type="button" aria-haspopup="menu" aria-label="More actions for Layla Haddad"><span class="oa-icon" aria-hidden="true" translate="no">more_vert</span></button></td>
</tr>
<tr>
<td class="oa-table__select"><label><input class="oa-check__input" type="checkbox" checked aria-label="Select Rami Khoury"></label></td>
<th scope="row">
<div class="oa-table__entry">
<span class="oa-avatar" aria-hidden="true">RK</span>
<a class="oa-title-link oa-table__link" href="#ct-person-rami">Rami Khoury<span class="oa-table__sub">rami.khoury@example.com</span></a>
</div>
</th>
<td><span class="oa-status-chip oa-status-chip--cat-blue"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">menu_book</span>Faculty</span></td>
<td>School of Business</td>
<td class="oa-table__id"><bdi dir="ltr" translate="no">GU-24-000481</bdi></td>
<td><span class="oa-status-chip oa-status-chip--warning"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">mail</span>Invited</span></td>
<td><span class="oa-table__empty" aria-hidden="true">—</span><span class="oa-visually-hidden">No sign-in recorded</span></td>
<td class="oa-table__actions"><button class="oa-icon-btn" type="button" aria-haspopup="menu" aria-label="More actions for Rami Khoury"><span class="oa-icon" aria-hidden="true" translate="no">more_vert</span></button></td>
</tr>
<tr>
<td class="oa-table__select"><label><input class="oa-check__input" type="checkbox" aria-label="Select Nour Saab"></label></td>
<th scope="row">
<div class="oa-table__entry">
<span class="oa-avatar" aria-hidden="true">NS</span>
<a class="oa-title-link oa-table__link" href="#ct-person-nour">Nour Saab<span class="oa-table__sub">nour.saab@example.com</span></a>
</div>
</th>
<td><span class="oa-status-chip oa-status-chip--cat-green"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">work</span>Staff</span></td>
<td><span class="oa-table__empty" aria-hidden="true">—</span><span class="oa-visually-hidden">No unit</span></td>
<td class="oa-table__id"><bdi dir="ltr" translate="no">GU-26-000077</bdi></td>
<td><span class="oa-status-chip oa-status-chip--error"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">block</span>Suspended</span></td>
<td>Yesterday</td>
<td class="oa-table__actions"><button class="oa-icon-btn" type="button" aria-haspopup="menu" aria-label="More actions for Nour Saab"><span class="oa-icon" aria-hidden="true" translate="no">more_vert</span></button></td>
</tr>
<tr>
<td class="oa-table__select"><label><input class="oa-check__input" type="checkbox" aria-label="Select Maya Khalil"></label></td>
<th scope="row">
<div class="oa-table__entry">
<span class="oa-avatar" aria-hidden="true">MK</span>
<a class="oa-title-link oa-table__link" href="#ct-person-maya">Maya Khalil<span class="oa-table__sub">No email yet</span></a>
</div>
</th>
<td><span class="oa-status-chip oa-status-chip--cat-indigo"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">confirmation_number</span>Guest</span></td>
<td><span class="oa-table__empty" aria-hidden="true">—</span><span class="oa-visually-hidden">No unit</span></td>
<td class="oa-table__id"><bdi dir="ltr" translate="no">GU-26-001204</bdi></td>
<td><span class="oa-status-chip oa-status-chip--warning"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">schedule</span>Pending activation</span></td>
<td><span class="oa-table__empty" aria-hidden="true">—</span><span class="oa-visually-hidden">No sign-in recorded</span></td>
<td class="oa-table__actions"><button class="oa-icon-btn" type="button" aria-haspopup="menu" aria-label="More actions for Maya Khalil"><span class="oa-icon" aria-hidden="true" translate="no">more_vert</span></button></td>
</tr>
</tbody>
</table>
</section>
</div>Compact rows and a numeric column:
<section class="oa-table-region" aria-label="Rows of the file" tabindex="0">
<table class="oa-table oa-table--compact" aria-label="Rows of the file" style="--oa-table-min-width: 40rem">
<thead>
<tr>
<th class="oa-table__num" scope="col">Row</th>
<th scope="col">Name</th>
<th scope="col">Mobile</th>
<th scope="col">What happens</th>
</tr>
</thead>
<tbody>
<tr>
<td class="oa-table__num">2</td>
<th scope="row">Rana Saleh</th>
<td><bdi dir="ltr">+961 71 214 723</bdi></td>
<td>New guest</td>
</tr>
<tr>
<td class="oa-table__num">3</td>
<th scope="row">Karim Nassar</th>
<td><bdi dir="ltr">+961 3 418 902</bdi></td>
<td>Already in Global ID: will be added to this list</td>
</tr>
<tr>
<td class="oa-table__num">14</td>
<th scope="row">Lina Farah</th>
<td><span class="oa-table__empty" aria-hidden="true">—</span><span class="oa-visually-hidden">No mobile</span></td>
<td>Already on this list</td>
</tr>
</tbody>
</table>
</section>Empty:
<section class="oa-table-region" aria-label="All people">
<div class="oa-empty">
<span class="oa-empty__disc" aria-hidden="true"><span class="oa-icon oa-icon--2xl" aria-hidden="true" translate="no">search_off</span></span>
<h4 class="oa-empty__title">No people match these filters</h4>
<p class="oa-empty__body">Try another type, unit, or status, or check the spelling of the name.</p>
<div class="oa-empty__actions">
<button class="oa-btn oa-btn--outlined" type="button">Clear filters</button>
</div>
</div>
</section>Arabic:
<section class="oa-table-region" aria-label="كل الأشخاص" tabindex="0">
<table class="oa-table" aria-label="كل الأشخاص" style="--oa-table-min-width: 52rem">
<thead>
<tr>
<th class="oa-table__select" scope="col"><label><input class="oa-check__input" type="checkbox" aria-label="تحديد كل الأشخاص المعروضين"></label></th>
<th scope="col" aria-sort="ascending"><button class="oa-table__sort" type="button">الاسم<span class="oa-icon" aria-hidden="true" translate="no">arrow_upward</span></button></th>
<th scope="col">النوع</th>
<th scope="col">رقم <bdi lang="en" translate="no">Global ID</bdi></th>
<th scope="col">الحالة</th>
<th scope="col">آخر تسجيل دخول</th>
</tr>
</thead>
<tbody>
<tr>
<td class="oa-table__select"><label><input class="oa-check__input" type="checkbox" aria-label="تحديد ليلى حداد"></label></td>
<th scope="row">
<div class="oa-table__entry">
<span class="oa-avatar" aria-hidden="true">لح</span>
<a class="oa-title-link oa-table__link" href="#ct-person-layla-ar">ليلى حداد<span class="oa-table__sub"><bdi dir="ltr">layla.haddad@example.com</bdi></span></a>
</div>
</th>
<td><span class="oa-status-chip oa-status-chip--cat-orange"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">school</span>طالب</span></td>
<td class="oa-table__id"><bdi dir="ltr" translate="no">GU-25-000123</bdi></td>
<td><span class="oa-status-chip oa-status-chip--success"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">check_circle</span>نشط</span></td>
<td>اليوم 08:42</td>
</tr>
<tr>
<td class="oa-table__select"><label><input class="oa-check__input" type="checkbox" aria-label="تحديد رامي خوري"></label></td>
<th scope="row">
<div class="oa-table__entry">
<span class="oa-avatar" aria-hidden="true">رخ</span>
<a class="oa-title-link oa-table__link" href="#ct-person-rami-ar">رامي خوري<span class="oa-table__sub"><bdi dir="ltr">rami.khoury@example.com</bdi></span></a>
</div>
</th>
<td><span class="oa-status-chip oa-status-chip--cat-blue"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">menu_book</span>عضو هيئة التدريس</span></td>
<td class="oa-table__id"><bdi dir="ltr" translate="no">GU-24-000481</bdi></td>
<td><span class="oa-status-chip oa-status-chip--warning"><span class="oa-icon oa-status-chip__icon" aria-hidden="true" translate="no">mail</span>مدعو</span></td>
<td><span class="oa-table__empty" aria-hidden="true">—</span><span class="oa-visually-hidden">لا يوجد تسجيل دخول</span></td>
</tr>
</tbody>
</table>
</section>Tailwind CSS v4
<section aria-label="All people" tabindex="0" class="relative overflow-x-auto rounded-box border border-outline-variant bg-card-outlined-container">
<table aria-label="All people" class="w-full min-w-260 border-collapse text-body-md text-on-surface">
<thead>
<tr>
<th scope="col" class="h-14 w-16 ps-2 text-start"><!-- 48px label around the select-all box --></th>
<th scope="col" aria-sort="ascending" class="h-14 p-0 text-start">
<button type="button" class="relative isolate flex min-h-14 w-full items-center gap-1 border border-transparent px-3 text-start text-label-md text-on-surface-variant whitespace-nowrap before:absolute before:-inset-px before:-z-1 before:bg-current before:opacity-0 hover:before:opacity-(--opacity-state-hover) active:before:opacity-(--opacity-state-pressed) focus-visible:-outline-offset-4">Name<!-- arrow_upward 18px --></button>
</th>
<th scope="col" class="h-14 px-3 text-start text-label-md whitespace-nowrap text-on-surface-variant">Global ID</th>
</tr>
</thead>
<tbody>
<tr class="h-16 has-[:checked]:bg-primary-container/30">
<td class="w-16 border-t border-outline-variant ps-2 align-middle">
<label class="relative isolate inline-flex size-12 cursor-pointer items-center justify-center rounded-full before:absolute before:inset-0 before:-z-1 before:rounded-full before:bg-current before:opacity-0 hover:before:opacity-(--opacity-state-hover)">
<input type="checkbox" aria-label="Select Layla Haddad" class="size-5 accent-primary-ink">
</label>
</td>
<th scope="row" class="border-t border-outline-variant px-3 text-start font-normal whitespace-nowrap">
<a href="/admin/people/layla-haddad" class="inline-flex min-h-12 flex-col justify-center text-label-md text-on-surface no-underline hover:underline">Layla Haddad<span class="text-body-md text-on-surface-variant">layla.haddad@example.com</span></a>
</th>
<td class="border-t border-outline-variant px-3 py-2 font-mono text-code-sm whitespace-nowrap"><bdi dir="ltr" translate="no">GU-25-000123</bdi></td>
</tr>
</tbody>
</table>
</section>
<!-- Numbers: text-end tabular-nums whitespace-nowrap. Compact rows: h-12; the record link takes min-h-6 (its 24px line) instead of min-h-12, plus relative after:absolute after:inset-x-0 after:inset-y-[calc((100%-3rem)/2)]; the row-action button adds focus-visible:-outline-offset-4. -->
<!-- Bulk bar: while nothing is ticked, render it sr-only with no aria-label, keeping the empty live count. -->
<section aria-label="People selected" class="flex flex-wrap items-center gap-x-3 gap-y-1 rounded-box border border-transparent bg-primary-container py-2 ps-5 pe-2 text-on-primary-container">
<!-- check_box 24px, FILL 1 -->
<p aria-live="polite" class="me-auto text-label-md">2 selected</p>
<!-- text buttons, sm -->
</section>Tailwind products keep the native checkbox drawing with accent-primary-ink (D-CAI-12); both read as the same control.
React
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
— | Required. Names the region and the table ("All people"). |
density |
"comfortable" | "compact" |
"comfortable" |
64px or 48px rows; compact only in consoles from md. |
minWidth |
string |
— | The sum of the columns, for example "65rem"; sets --oa-table-min-width. |
columns |
{ key; header; align?: "start" | "end"; kind?: "text" | "number" | "id"; sortable?: boolean }[] |
— | number aligns to the end with tabular figures; id is mono and LTR. |
rows |
Row[] |
— | Each row gives its record href and a rowHeader (name, second line, avatar). |
sort |
{ key: string; direction: "ascending" | "descending" } |
— | Sets aria-sort on that column only. |
onSortChange |
(sort) => void |
— | Toggles the direction on a second press. |
selection |
ReadonlySet<string> |
— | Ticked row ids; the header box is indeterminate when some are ticked. |
onSelectionChange |
(ids) => void |
— | Clearing results clears the selection. |
selectLabel |
(row) => string |
— | "Select {name}". |
rowActions |
(row) => MenuItem[] |
— | Renders "More actions for {name}". |
empty |
ReactNode |
— | The empty state shown inside the region. |
loading |
boolean |
false |
Five skeleton rows; the region aria-busy. |
<BulkBar count={selection.size} label={t('bulk.label')} text={t('bulk.selected', { count: selection.size })}>
<Button variant="text" size="sm" icon="content_copy" onClick={copyEmails}>{t('bulk.copy')}</Button>
<Button variant="text" size="sm" icon="close" onClick={clear}>{t('bulk.clear')}</Button>
</BulkBar>
<DataTable label={t('list')} minWidth="65rem" columns={columns} rows={rows} sort={sort} onSortChange={setSort}
selection={selection} onSelectionChange={setSelection} selectLabel={(r) => t('select', { name: r.name })} />
<Pagination from={1} to={25} total={48} page={1} pages={2} />