Tree Tables
Tables whose rows have children (sk-tree-table): open and close, icons, expand all, lazy loading, and selection with a mixed state.
Basic
data is a flat list: every row has an id, and a child names its parent. The component works out the level of every row and whether it has children, and every parent starts closed. A parent has a button with aria-expanded that opens and closes it; a row shows when none of its ancestors is closed. The first field is the tree column: the button, the icon, and the content, indented by level, with “Level 2:” for a screen reader. format builds the content of a cell (here the star of the department lead). The caption has markup (the caption slot), and the header stays in view (sticky-header).
| Name | Head | Members | Budget |
|---|---|---|---|
Level 1: Engineering | Priya Nair | 48 | $4.2M |
Level 2: Platform | Daniel Kim | 18 | $1.8M |
Level 3: Infrastructure | Sofia Rossi | 9 | $0.9M |
Level 3: Developer tools | Liam Chen | 9 | $0.9M |
Level 2: Product | Mia Sato | 30 | $2.4M |
<div id="departments-tree-wrapper" data-tree-table class="space-y-3">
<div
class="isolate overflow-auto rounded-xl border border-dominant-200 dark:border-dominant-700 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-none dark:focus-visible:ring-primary-400 max-h-96"
tabindex="0"
role="region"
aria-labelledby="departments-tree-caption"
>
<table
id="departments-tree"
class="w-full border-separate border-spacing-0 text-left text-sm [&_th]:px-4 [&_td]:px-4 [&_th]:whitespace-nowrap [&_td]:whitespace-nowrap [&_td]:text-dominant-700 dark:[&_td]:text-dominant-200 [&_tbody_th]:font-medium [&_tbody_th]:text-dominant-900 dark:[&_tbody_th]:text-white [&_thead_th]:text-xs [&_thead_th]:font-semibold [&_thead_th]:tracking-wide [&_thead_th]:uppercase [&_thead_tr:last-child>*]:border-b [&_thead_tr:last-child>*]:border-dominant-300 dark:[&_thead_tr:last-child>*]:border-dominant-600 [&_tbody>tr+tr>*]:border-t [&_tbody>tr>*]:border-dominant-200 dark:[&_tbody>tr>*]:border-dominant-700 [&_tfoot>tr>*]:border-t [&_tfoot>tr>*]:border-dominant-300 dark:[&_tfoot>tr>*]:border-dominant-600 [&_tfoot>tr>*]:font-semibold [&_thead_th]:bg-dominant-200 dark:[&_thead_th]:bg-dominant-700 [&_thead_th]:text-dominant-800 dark:[&_thead_th]:text-dominant-100 [&_thead_td]:bg-dominant-100 dark:[&_thead_td]:bg-dominant-800 [&_tfoot>tr>*]:bg-dominant-100 dark:[&_tfoot>tr>*]:bg-dominant-800 [&_tfoot>tr>*]:text-dominant-900 dark:[&_tfoot>tr>*]:text-white [&_.table-sticky-left]:sticky [&_.table-sticky-right]:sticky [&_tbody_.table-sticky-left]:z-10 [&_tbody_.table-sticky-right]:z-10 [&_tbody_.table-sticky-left]:bg-white dark:[&_tbody_.table-sticky-left]:bg-dominant-900 [&_tbody_.table-sticky-right]:bg-white dark:[&_tbody_.table-sticky-right]:bg-dominant-900 [&_thead_th.table-sticky-left]:z-30 [&_thead_th.table-sticky-right]:z-30 [&_thead_td.table-sticky-left]:z-10 [&_thead_td.table-sticky-right]:z-10 [&_th]:py-3 [&_td]:py-3 [&_tbody>tr:nth-child(even)]:bg-dominant-50 dark:[&_tbody>tr:nth-child(even)]:bg-dominant-800/40 [&_tbody>tr:nth-child(even)>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:nth-child(even)>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:nth-child(even)>.table-sticky-left]:from-dominant-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-left]:from-dominant-800/40 [&_tbody>tr:nth-child(even)>.table-sticky-right]:from-dominant-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-right]:from-dominant-800/40 [&_tbody>tr:nth-child(even)>.table-sticky-left]:to-dominant-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-left]:to-dominant-800/40 [&_tbody>tr:nth-child(even)>.table-sticky-right]:to-dominant-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-right]:to-dominant-800/40 [&_tbody>tr:hover]:bg-dominant-100 dark:[&_tbody>tr:hover]:bg-dominant-800 [&_tbody>tr:nth-child(even):hover]:bg-dominant-100 dark:[&_tbody>tr:nth-child(even):hover]:bg-dominant-800 [&_tbody>tr:hover>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:hover>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:hover>.table-sticky-left]:from-dominant-100 dark:[&_tbody>tr:hover>.table-sticky-left]:from-dominant-800 [&_tbody>tr:hover>.table-sticky-right]:from-dominant-100 dark:[&_tbody>tr:hover>.table-sticky-right]:from-dominant-800 [&_tbody>tr:hover>.table-sticky-left]:to-dominant-100 dark:[&_tbody>tr:hover>.table-sticky-left]:to-dominant-800 [&_tbody>tr:hover>.table-sticky-right]:to-dominant-100 dark:[&_tbody>tr:hover>.table-sticky-right]:to-dominant-800 [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:from-dominant-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-left]:from-dominant-800 [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:from-dominant-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-right]:from-dominant-800 [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:to-dominant-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-left]:to-dominant-800 [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:to-dominant-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-right]:to-dominant-800 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-20"
>
<caption
id="departments-tree-caption"
class="px-4 py-3 text-left text-sm font-semibold text-dominant-900 dark:text-white"
>
Departments
<span class="font-normal text-dominant-600 dark:text-dominant-300">and their teams</span>
</caption>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Head</th>
<th scope="col" class="text-right">Members</th>
<th scope="col" class="text-right">Budget</th>
</tr>
</thead>
<tbody>
<tr data-row="n1" data-level="1">
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Engineering"
data-node="n1"
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><span><span class="sr-only">Level 1: </span>Engineering</span>
</div>
</th>
<td>
<i
aria-hidden="true"
class="fa-solid fa-star mr-2 text-warning-600 dark:text-warning-400"
></i
>Priya Nair
</td>
<td class="text-right">48</td>
<td class="text-right">$4.2M</td>
</tr>
<tr data-row="n2" data-level="2" data-parent="n1" hidden>
<th scope="row" class="pr-4 pl-9!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Platform"
data-node="n2"
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><span><span class="sr-only">Level 2: </span>Platform</span>
</div>
</th>
<td>Daniel Kim</td>
<td class="text-right">18</td>
<td class="text-right">$1.8M</td>
</tr>
<tr data-row="n3" data-level="3" data-parent="n2" hidden>
<th scope="row" class="pr-4 pl-15!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 3: </span>Infrastructure</span>
</div>
</th>
<td>Sofia Rossi</td>
<td class="text-right">9</td>
<td class="text-right">$0.9M</td>
</tr>
<tr data-row="n4" data-level="3" data-parent="n2" hidden>
<th scope="row" class="pr-4 pl-15!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 3: </span>Developer tools</span>
</div>
</th>
<td>Liam Chen</td>
<td class="text-right">9</td>
<td class="text-right">$0.9M</td>
</tr>
<tr data-row="n5" data-level="2" data-parent="n1" hidden>
<th scope="row" class="pr-4 pl-9!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 2: </span>Product</span>
</div>
</th>
<td>Mia Sato</td>
<td class="text-right">30</td>
<td class="text-right">$2.4M</td>
</tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
</div>
Icons and expand all
icon on a row puts an icon in the tree column (full Font Awesome classes), so a folder looks different from a file. expand-actions adds Expand all
and Collapse all
, which open or close every parent of the table; the toolbar slot adds a button next to them. The Name column is sticky (sticky: 'left' in fields), and the foot slot holds a total that stays at the bottom (sticky-footer).
| Name | Size | Modified |
|---|---|---|
Level 1: Documents | — | Nov 10, 2026 |
Level 2: Reports | — | Nov 10, 2026 |
Level 3: q1-report.pdf | 2.4 MB | Apr 2, 2026 |
Level 3: q2-report.pdf | 2.1 MB | Jul 3, 2026 |
Level 2: contract.pdf | 1.2 MB | Oct 28, 2026 |
Level 1: Images | — | Nov 2, 2026 |
Level 2: logo.webp | 48 KB | Jan 14, 2026 |
Level 2: banner.webp | 212 KB | Nov 2, 2026 |
Level 1: readme.txt | 3 KB | Sep 9, 2026 |
| Total | 9 items |
<div id="files-tree-wrapper" data-tree-table class="space-y-3">
<div class="flex flex-wrap items-center gap-2">
<button
id="button-1567"
type="button"
data-tree-all="expand"
data-tree-target="files-tree"
class="cursor-pointer transition-colors inline-flex items-center justify-center rounded-lg font-semibold group peer focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:focus-visible:ring-offset-dominant-950 inset-ring inset-ring-dominant-300 dark:inset-ring-dominant-600 bg-white dark:bg-dominant-800 text-dominant-700 dark:text-dominant-200 dark:shadow-none shadow-sm not-disabled:hover:bg-dominant-100 dark:not-disabled:hover:bg-dominant-700 not-disabled:hover:text-dominant-900 dark:not-disabled:hover:text-white not-disabled:active:bg-dominant-200 dark:not-disabled:active:bg-dominant-600 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 gap-1.5 px-3 py-1.5 text-sm"
>
<i aria-hidden="true" class="fa-solid fa-angles-down"></i><span>Expand all</span>
</button>
<button
id="button-1657"
type="button"
data-tree-all="collapse"
data-tree-target="files-tree"
class="cursor-pointer transition-colors inline-flex items-center justify-center rounded-lg font-semibold group peer focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:focus-visible:ring-offset-dominant-950 inset-ring inset-ring-dominant-300 dark:inset-ring-dominant-600 bg-white dark:bg-dominant-800 text-dominant-700 dark:text-dominant-200 dark:shadow-none shadow-sm not-disabled:hover:bg-dominant-100 dark:not-disabled:hover:bg-dominant-700 not-disabled:hover:text-dominant-900 dark:not-disabled:hover:text-white not-disabled:active:bg-dominant-200 dark:not-disabled:active:bg-dominant-600 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 gap-1.5 px-3 py-1.5 text-sm"
>
<i aria-hidden="true" class="fa-solid fa-angles-up"></i><span>Collapse all</span>
</button>
<button
id="button-1726"
type="button"
class="cursor-pointer transition-colors inline-flex items-center justify-center rounded-lg font-semibold group peer focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:focus-visible:ring-offset-dominant-950 bg-primary-600 text-white shadow-sm not-disabled:hover:bg-primary-700 not-disabled:active:bg-primary-800 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 in-[.button-group-subtle]:bg-primary-100 in-[.button-group-subtle]:text-primary-800 in-[.button-group-subtle]:not-disabled:hover:bg-primary-200 in-[.button-group-subtle]:not-disabled:active:bg-primary-300 in-[.button-group-subtle]:focus-visible:ring-primary-700 in-[.button-group-subtle]:dark:bg-primary-900/50 in-[.button-group-subtle]:dark:text-primary-300 in-[.button-group-subtle]:dark:not-disabled:hover:bg-primary-900 in-[.button-group-subtle]:dark:focus-visible:ring-primary-400 in-[.button-group-subtle]:shadow-none in-[.button-group-outline]:inset-ring in-[.button-group-outline]:inset-ring-primary-300 in-[.button-group-outline]:bg-white in-[.button-group-outline]:text-primary-800 in-[.button-group-outline]:shadow-sm in-[.button-group-outline]:not-disabled:hover:bg-primary-50 in-[.button-group-outline]:not-disabled:active:bg-primary-100 in-[.button-group-outline]:focus-visible:ring-primary-700 in-[.button-group-outline]:dark:inset-ring-primary-700 in-[.button-group-outline]:dark:bg-dominant-900 in-[.button-group-outline]:dark:text-primary-200 in-[.button-group-outline]:dark:shadow-none in-[.button-group-outline]:dark:not-disabled:hover:bg-primary-900/50 in-[.button-group-outline]:dark:focus-visible:ring-primary-400 button-selected:bg-primary-600 button-selected:text-white button-selected:inset-ring-primary-600 button-selected:not-disabled:hover:bg-primary-700 button-selected:not-disabled:hover:text-white button-selected:not-disabled:active:bg-primary-800 button-selected:dark:bg-primary-600 button-selected:dark:inset-ring-primary-600 button-selected:dark:text-white button-selected:dark:not-disabled:hover:bg-primary-700 button-selected:dark:not-disabled:hover:text-white button-selected:dark:not-disabled:active:bg-primary-800 button-selected:in-[.button-group-solid]:bg-primary-800 button-selected:in-[.button-group-solid]:not-disabled:hover:bg-primary-800 button-selected:in-[.button-group-solid]:dark:bg-primary-800 button-selected:in-[.button-group-solid]:dark:not-disabled:hover:bg-primary-800 gap-1.5 px-3 py-1.5 text-sm"
>
<i aria-hidden="true" class="fa-solid fa-folder-plus"></i><span>New folder</span>
</button>
</div>
<div
class="isolate overflow-auto rounded-xl border border-dominant-200 dark:border-dominant-700 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-none dark:focus-visible:ring-primary-400 max-h-96"
tabindex="0"
role="region"
aria-labelledby="files-tree-caption"
>
<table
id="files-tree"
class="w-full border-separate border-spacing-0 text-left text-sm [&_th]:px-4 [&_td]:px-4 [&_th]:whitespace-nowrap [&_td]:whitespace-nowrap [&_td]:text-dominant-700 dark:[&_td]:text-dominant-200 [&_tbody_th]:font-medium [&_tbody_th]:text-dominant-900 dark:[&_tbody_th]:text-white [&_thead_th]:text-xs [&_thead_th]:font-semibold [&_thead_th]:tracking-wide [&_thead_th]:uppercase [&_thead_tr:last-child>*]:border-b [&_thead_tr:last-child>*]:border-dominant-300 dark:[&_thead_tr:last-child>*]:border-dominant-600 [&_tbody>tr+tr>*]:border-t [&_tbody>tr>*]:border-dominant-200 dark:[&_tbody>tr>*]:border-dominant-700 [&_tfoot>tr>*]:border-t [&_tfoot>tr>*]:border-dominant-300 dark:[&_tfoot>tr>*]:border-dominant-600 [&_tfoot>tr>*]:font-semibold [&_thead_th]:bg-primary-200 dark:[&_thead_th]:bg-primary-950 [&_thead_th]:text-primary-900 dark:[&_thead_th]:text-primary-100 [&_thead_td]:bg-primary-100 dark:[&_thead_td]:bg-primary-950 [&_tfoot>tr>*]:bg-primary-100 dark:[&_tfoot>tr>*]:bg-primary-950 [&_tfoot>tr>*]:text-primary-900 dark:[&_tfoot>tr>*]:text-primary-100 [&_.table-sticky-left]:sticky [&_.table-sticky-right]:sticky [&_tbody_.table-sticky-left]:z-10 [&_tbody_.table-sticky-right]:z-10 [&_tbody_.table-sticky-left]:bg-white dark:[&_tbody_.table-sticky-left]:bg-dominant-900 [&_tbody_.table-sticky-right]:bg-white dark:[&_tbody_.table-sticky-right]:bg-dominant-900 [&_thead_th.table-sticky-left]:z-30 [&_thead_th.table-sticky-right]:z-30 [&_thead_td.table-sticky-left]:z-10 [&_thead_td.table-sticky-right]:z-10 [&_th]:py-3 [&_td]:py-3 [&_tbody>tr:nth-child(even)]:bg-primary-50 dark:[&_tbody>tr:nth-child(even)]:bg-primary-900/20 [&_tbody>tr:nth-child(even)>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:nth-child(even)>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:nth-child(even)>.table-sticky-left]:from-primary-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-left]:from-primary-900/20 [&_tbody>tr:nth-child(even)>.table-sticky-right]:from-primary-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-right]:from-primary-900/20 [&_tbody>tr:nth-child(even)>.table-sticky-left]:to-primary-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-left]:to-primary-900/20 [&_tbody>tr:nth-child(even)>.table-sticky-right]:to-primary-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-right]:to-primary-900/20 [&_tbody>tr:hover]:bg-primary-100 dark:[&_tbody>tr:hover]:bg-primary-900/40 [&_tbody>tr:nth-child(even):hover]:bg-primary-100 dark:[&_tbody>tr:nth-child(even):hover]:bg-primary-900/40 [&_tbody>tr:hover>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:hover>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:hover>.table-sticky-left]:from-primary-100 dark:[&_tbody>tr:hover>.table-sticky-left]:from-primary-900/40 [&_tbody>tr:hover>.table-sticky-right]:from-primary-100 dark:[&_tbody>tr:hover>.table-sticky-right]:from-primary-900/40 [&_tbody>tr:hover>.table-sticky-left]:to-primary-100 dark:[&_tbody>tr:hover>.table-sticky-left]:to-primary-900/40 [&_tbody>tr:hover>.table-sticky-right]:to-primary-100 dark:[&_tbody>tr:hover>.table-sticky-right]:to-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:from-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-left]:from-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:from-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-right]:from-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:to-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-left]:to-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:to-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-right]:to-primary-900/40 [&_tfoot>tr>*]:sticky [&_tfoot>tr>*]:bottom-0 [&_tfoot>tr>*]:z-20"
>
<caption
id="files-tree-caption"
class="px-4 py-3 text-left text-sm font-semibold text-dominant-900 dark:text-white"
>
Files and folders
</caption>
<thead>
<tr>
<th scope="col" class="table-sticky-left">Name</th>
<th scope="col" class="text-right">Size</th>
<th scope="col">Modified</th>
</tr>
</thead>
<tbody>
<tr data-row="n1" data-level="1">
<th scope="row" class="pr-4 pl-3! table-sticky-left">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Documents"
data-node="n1"
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><i
aria-hidden="true"
class="fa-solid fa-folder-open text-warning-700 dark:text-warning-300 w-4 text-center"
></i
><span><span class="sr-only">Level 1: </span>Documents</span>
</div>
</th>
<td class="text-right">—</td>
<td>Nov 10, 2026</td>
</tr>
<tr data-row="n2" data-level="2" data-parent="n1" hidden>
<th scope="row" class="pr-4 pl-9! table-sticky-left">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Reports"
data-node="n2"
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><i
aria-hidden="true"
class="fa-solid fa-folder-open text-warning-700 dark:text-warning-300 w-4 text-center"
></i
><span><span class="sr-only">Level 2: </span>Reports</span>
</div>
</th>
<td class="text-right">—</td>
<td>Nov 10, 2026</td>
</tr>
<tr data-row="n3" data-level="3" data-parent="n2" hidden>
<th scope="row" class="pr-4 pl-15! table-sticky-left">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><i
aria-hidden="true"
class="fa-solid fa-file-pdf text-dominant-600 dark:text-dominant-300 w-4 text-center"
></i
><span><span class="sr-only">Level 3: </span>q1-report.pdf</span>
</div>
</th>
<td class="text-right">2.4 MB</td>
<td>Apr 2, 2026</td>
</tr>
<tr data-row="n4" data-level="3" data-parent="n2" hidden>
<th scope="row" class="pr-4 pl-15! table-sticky-left">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><i
aria-hidden="true"
class="fa-solid fa-file-pdf text-dominant-600 dark:text-dominant-300 w-4 text-center"
></i
><span><span class="sr-only">Level 3: </span>q2-report.pdf</span>
</div>
</th>
<td class="text-right">2.1 MB</td>
<td>Jul 3, 2026</td>
</tr>
<tr data-row="n5" data-level="2" data-parent="n1" hidden>
<th scope="row" class="pr-4 pl-9! table-sticky-left">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><i
aria-hidden="true"
class="fa-solid fa-file-pdf text-dominant-600 dark:text-dominant-300 w-4 text-center"
></i
><span><span class="sr-only">Level 2: </span>contract.pdf</span>
</div>
</th>
<td class="text-right">1.2 MB</td>
<td>Oct 28, 2026</td>
</tr>
<tr data-row="n6" data-level="1">
<th scope="row" class="pr-4 pl-3! table-sticky-left">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Images"
data-node="n6"
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><i
aria-hidden="true"
class="fa-solid fa-folder-open text-warning-700 dark:text-warning-300 w-4 text-center"
></i
><span><span class="sr-only">Level 1: </span>Images</span>
</div>
</th>
<td class="text-right">—</td>
<td>Nov 2, 2026</td>
</tr>
<tr data-row="n7" data-level="2" data-parent="n6" hidden>
<th scope="row" class="pr-4 pl-9! table-sticky-left">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><i
aria-hidden="true"
class="fa-solid fa-file-image text-dominant-600 dark:text-dominant-300 w-4 text-center"
></i
><span><span class="sr-only">Level 2: </span>logo.webp</span>
</div>
</th>
<td class="text-right">48 KB</td>
<td>Jan 14, 2026</td>
</tr>
<tr data-row="n8" data-level="2" data-parent="n6" hidden>
<th scope="row" class="pr-4 pl-9! table-sticky-left">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><i
aria-hidden="true"
class="fa-solid fa-file-image text-dominant-600 dark:text-dominant-300 w-4 text-center"
></i
><span><span class="sr-only">Level 2: </span>banner.webp</span>
</div>
</th>
<td class="text-right">212 KB</td>
<td>Nov 2, 2026</td>
</tr>
<tr data-row="n9" data-level="1">
<th scope="row" class="pr-4 pl-3! table-sticky-left">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><i
aria-hidden="true"
class="fa-solid fa-file-lines text-dominant-600 dark:text-dominant-300 w-4 text-center"
></i
><span><span class="sr-only">Level 1: </span>readme.txt</span>
</div>
</th>
<td class="text-right">3 KB</td>
<td>Sep 9, 2026</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Total</th>
<td class="text-right">9 items</td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
Lazy loading
A lazy row has no children yet. The first time it opens, the table shows Loading…
, sets aria-busy, and sends tree-load with the row id. The page adds the child rows and answers with tree-loaded; an empty folder says so, and tree-failed shows Could not load this folder.
with Try again
(the Archive folder fails once, so you can see it). This page adds the rows with a small script; replace fetchChildren() with your own request.
| Name | Size | Modified |
|---|---|---|
Level 1: Documents | — | Nov 10, 2026 |
Level 1: Images | — | Nov 2, 2026 |
Level 1: Archive | — | Dec 31, 2025 |
Level 1: Drafts | — | Aug 1, 2026 |
Level 1: readme.txt | 3 KB | Sep 9, 2026 |
<div id="lazy-files-tree-wrapper" data-tree-table class="space-y-3">
<div
class="isolate overflow-auto rounded-xl border border-dominant-200 dark:border-dominant-700 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-none dark:focus-visible:ring-primary-400"
tabindex="0"
role="region"
aria-labelledby="lazy-files-tree-caption"
>
<table
id="lazy-files-tree"
class="w-full border-separate border-spacing-0 text-left text-sm [&_th]:px-4 [&_td]:px-4 [&_th]:whitespace-nowrap [&_td]:whitespace-nowrap [&_td]:text-dominant-700 dark:[&_td]:text-dominant-200 [&_tbody_th]:font-medium [&_tbody_th]:text-dominant-900 dark:[&_tbody_th]:text-white [&_thead_th]:text-xs [&_thead_th]:font-semibold [&_thead_th]:tracking-wide [&_thead_th]:uppercase [&_thead_tr:last-child>*]:border-b [&_thead_tr:last-child>*]:border-dominant-300 dark:[&_thead_tr:last-child>*]:border-dominant-600 [&_tbody>tr+tr>*]:border-t [&_tbody>tr>*]:border-dominant-200 dark:[&_tbody>tr>*]:border-dominant-700 [&_tfoot>tr>*]:border-t [&_tfoot>tr>*]:border-dominant-300 dark:[&_tfoot>tr>*]:border-dominant-600 [&_tfoot>tr>*]:font-semibold [&_thead_th]:bg-primary-200 dark:[&_thead_th]:bg-primary-950 [&_thead_th]:text-primary-900 dark:[&_thead_th]:text-primary-100 [&_thead_td]:bg-primary-100 dark:[&_thead_td]:bg-primary-950 [&_tfoot>tr>*]:bg-primary-100 dark:[&_tfoot>tr>*]:bg-primary-950 [&_tfoot>tr>*]:text-primary-900 dark:[&_tfoot>tr>*]:text-primary-100 [&_.table-sticky-left]:sticky [&_.table-sticky-right]:sticky [&_tbody_.table-sticky-left]:z-10 [&_tbody_.table-sticky-right]:z-10 [&_tbody_.table-sticky-left]:bg-white dark:[&_tbody_.table-sticky-left]:bg-dominant-900 [&_tbody_.table-sticky-right]:bg-white dark:[&_tbody_.table-sticky-right]:bg-dominant-900 [&_thead_th.table-sticky-left]:z-30 [&_thead_th.table-sticky-right]:z-30 [&_thead_td.table-sticky-left]:z-10 [&_thead_td.table-sticky-right]:z-10 [&_th]:py-3 [&_td]:py-3 [&_tbody>tr:hover]:bg-primary-100 dark:[&_tbody>tr:hover]:bg-primary-900/40 [&_tbody>tr:nth-child(even):hover]:bg-primary-100 dark:[&_tbody>tr:nth-child(even):hover]:bg-primary-900/40 [&_tbody>tr:hover>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:hover>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:hover>.table-sticky-left]:from-primary-100 dark:[&_tbody>tr:hover>.table-sticky-left]:from-primary-900/40 [&_tbody>tr:hover>.table-sticky-right]:from-primary-100 dark:[&_tbody>tr:hover>.table-sticky-right]:from-primary-900/40 [&_tbody>tr:hover>.table-sticky-left]:to-primary-100 dark:[&_tbody>tr:hover>.table-sticky-left]:to-primary-900/40 [&_tbody>tr:hover>.table-sticky-right]:to-primary-100 dark:[&_tbody>tr:hover>.table-sticky-right]:to-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:from-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-left]:from-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:from-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-right]:from-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:to-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-left]:to-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:to-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-right]:to-primary-900/40"
>
<caption
id="lazy-files-tree-caption"
class="px-4 py-3 text-left text-sm font-semibold text-dominant-900 dark:text-white"
>
Files with lazy loading
</caption>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col" class="text-right">Size</th>
<th scope="col">Modified</th>
</tr>
</thead>
<tbody>
<tr data-row="documents" data-level="1">
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Documents"
data-node="documents"
data-lazy
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><i
aria-hidden="true"
class="fa-solid fa-folder-open text-warning-700 dark:text-warning-300 w-4 text-center"
></i
><span><span class="sr-only">Level 1: </span>Documents</span>
</div>
</th>
<td class="text-right">—</td>
<td>Nov 10, 2026</td>
</tr>
<tr data-row="images" data-level="1">
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Images"
data-node="images"
data-lazy
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><i
aria-hidden="true"
class="fa-solid fa-folder-open text-warning-700 dark:text-warning-300 w-4 text-center"
></i
><span><span class="sr-only">Level 1: </span>Images</span>
</div>
</th>
<td class="text-right">—</td>
<td>Nov 2, 2026</td>
</tr>
<tr data-row="archive" data-level="1">
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Archive"
data-node="archive"
data-lazy
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><i
aria-hidden="true"
class="fa-solid fa-folder-open text-warning-700 dark:text-warning-300 w-4 text-center"
></i
><span><span class="sr-only">Level 1: </span>Archive</span>
</div>
</th>
<td class="text-right">—</td>
<td>Dec 31, 2025</td>
</tr>
<tr data-row="empty" data-level="1">
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Drafts"
data-node="empty"
data-lazy
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><i
aria-hidden="true"
class="fa-solid fa-folder-open text-warning-700 dark:text-warning-300 w-4 text-center"
></i
><span><span class="sr-only">Level 1: </span>Drafts</span>
</div>
</th>
<td class="text-right">—</td>
<td>Aug 1, 2026</td>
</tr>
<tr data-row="readme" data-level="1">
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><i
aria-hidden="true"
class="fa-solid fa-file-lines text-dominant-600 dark:text-dominant-300 w-4 text-center"
></i
><span><span class="sr-only">Level 1: </span>readme.txt</span>
</div>
</th>
<td class="text-right">3 KB</td>
<td>Sep 9, 2026</td>
</tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
</div>
Selection
selectable puts a checkbox on every row and one in the header. Checking a parent checks all its descendants; a parent with only some checked rows is mixed (indeterminate, read as “partially checked”). The status above the table counts the checked rows and is announced (aria-live="polite"). This table is compact and bordered.
0 of 9 rows selected
| Category | Products | In stock | |
|---|---|---|---|
Level 1: Electronics | 142 | 1,180 | |
Level 2: Computers | 64 | 410 | |
Level 3: Laptops | 38 | 220 | |
Level 3: Desktops | 26 | 190 | |
Level 2: Audio | 78 | 770 | |
Level 1: Accessories | 96 | 2,040 | |
Level 2: Mice | 31 | 860 | |
Level 2: Keyboards | 65 | 1,180 | |
Level 1: Storage | 54 | 530 |
<div id="categories-tree-wrapper" data-tree-table class="space-y-3">
<div class="flex flex-wrap items-center gap-2">
<p
aria-live="polite"
data-select-count
class="text-sm text-dominant-700 dark:text-dominant-200 sm:ml-auto"
>
0 of 9 rows selected
</p>
</div>
<div
class="isolate overflow-auto rounded-xl border border-dominant-200 dark:border-dominant-700 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-none dark:focus-visible:ring-primary-400"
tabindex="0"
role="region"
aria-labelledby="categories-tree-caption"
>
<table
id="categories-tree"
class="w-full border-separate border-spacing-0 text-left text-sm [&_th]:px-4 [&_td]:px-4 [&_th]:whitespace-nowrap [&_td]:whitespace-nowrap [&_td]:text-dominant-700 dark:[&_td]:text-dominant-200 [&_tbody_th]:font-medium [&_tbody_th]:text-dominant-900 dark:[&_tbody_th]:text-white [&_thead_th]:text-xs [&_thead_th]:font-semibold [&_thead_th]:tracking-wide [&_thead_th]:uppercase [&_thead_tr:last-child>*]:border-b [&_thead_tr:last-child>*]:border-dominant-300 dark:[&_thead_tr:last-child>*]:border-dominant-600 [&_tbody>tr+tr>*]:border-t [&_tbody>tr>*]:border-dominant-200 dark:[&_tbody>tr>*]:border-dominant-700 [&_tfoot>tr>*]:border-t [&_tfoot>tr>*]:border-dominant-300 dark:[&_tfoot>tr>*]:border-dominant-600 [&_tfoot>tr>*]:font-semibold [&_thead_th]:bg-primary-200 dark:[&_thead_th]:bg-primary-950 [&_thead_th]:text-primary-900 dark:[&_thead_th]:text-primary-100 [&_thead_td]:bg-primary-100 dark:[&_thead_td]:bg-primary-950 [&_tfoot>tr>*]:bg-primary-100 dark:[&_tfoot>tr>*]:bg-primary-950 [&_tfoot>tr>*]:text-primary-900 dark:[&_tfoot>tr>*]:text-primary-100 [&_.table-sticky-left]:sticky [&_.table-sticky-right]:sticky [&_tbody_.table-sticky-left]:z-10 [&_tbody_.table-sticky-right]:z-10 [&_tbody_.table-sticky-left]:bg-white dark:[&_tbody_.table-sticky-left]:bg-dominant-900 [&_tbody_.table-sticky-right]:bg-white dark:[&_tbody_.table-sticky-right]:bg-dominant-900 [&_thead_th.table-sticky-left]:z-30 [&_thead_th.table-sticky-right]:z-30 [&_thead_td.table-sticky-left]:z-10 [&_thead_td.table-sticky-right]:z-10 [&_th]:py-2 [&_td]:py-2 [&_tbody>tr:nth-child(even)]:bg-primary-50 dark:[&_tbody>tr:nth-child(even)]:bg-primary-900/20 [&_tbody>tr:nth-child(even)>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:nth-child(even)>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:nth-child(even)>.table-sticky-left]:from-primary-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-left]:from-primary-900/20 [&_tbody>tr:nth-child(even)>.table-sticky-right]:from-primary-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-right]:from-primary-900/20 [&_tbody>tr:nth-child(even)>.table-sticky-left]:to-primary-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-left]:to-primary-900/20 [&_tbody>tr:nth-child(even)>.table-sticky-right]:to-primary-50 dark:[&_tbody>tr:nth-child(even)>.table-sticky-right]:to-primary-900/20 [&_tbody>tr:hover]:bg-primary-100 dark:[&_tbody>tr:hover]:bg-primary-900/40 [&_tbody>tr:nth-child(even):hover]:bg-primary-100 dark:[&_tbody>tr:nth-child(even):hover]:bg-primary-900/40 [&_tbody>tr:hover>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:hover>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:hover>.table-sticky-left]:from-primary-100 dark:[&_tbody>tr:hover>.table-sticky-left]:from-primary-900/40 [&_tbody>tr:hover>.table-sticky-right]:from-primary-100 dark:[&_tbody>tr:hover>.table-sticky-right]:from-primary-900/40 [&_tbody>tr:hover>.table-sticky-left]:to-primary-100 dark:[&_tbody>tr:hover>.table-sticky-left]:to-primary-900/40 [&_tbody>tr:hover>.table-sticky-right]:to-primary-100 dark:[&_tbody>tr:hover>.table-sticky-right]:to-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:bg-linear-to-r [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:bg-linear-to-r [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:from-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-left]:from-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:from-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-right]:from-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-left]:to-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-left]:to-primary-900/40 [&_tbody>tr:nth-child(even):hover>.table-sticky-right]:to-primary-100 dark:[&_tbody>tr:nth-child(even):hover>.table-sticky-right]:to-primary-900/40 [&_tr>*+*]:border-l [&_tr>*]:border-dominant-200 dark:[&_tr>*]:border-dominant-700"
>
<caption
id="categories-tree-caption"
class="px-4 py-3 text-left text-sm font-semibold text-dominant-900 dark:text-white"
>
Product categories
</caption>
<thead>
<tr>
<th scope="col" class="w-12">
<div id="categories-tree-select-all-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-all"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
aria-label="Select all rows"
data-select-all
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</th>
<th scope="col">Category</th>
<th scope="col" class="text-right">Products</th>
<th scope="col" class="text-right">In stock</th>
</tr>
</thead>
<tbody>
<tr data-row="electronics" data-level="1">
<td class="w-12">
<div id="categories-tree-select-electronics-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-electronics"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="electronics"
aria-label="Select Electronics"
data-select-row="electronics"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Electronics"
data-node="electronics"
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><span><span class="sr-only">Level 1: </span>Electronics</span>
</div>
</th>
<td class="text-right">142</td>
<td class="text-right">1,180</td>
</tr>
<tr data-row="computers" data-level="2" data-parent="electronics" hidden>
<td class="w-12">
<div id="categories-tree-select-computers-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-computers"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="computers"
aria-label="Select Computers"
data-select-row="computers"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-9!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Computers"
data-node="computers"
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><span><span class="sr-only">Level 2: </span>Computers</span>
</div>
</th>
<td class="text-right">64</td>
<td class="text-right">410</td>
</tr>
<tr data-row="laptops" data-level="3" data-parent="computers" hidden>
<td class="w-12">
<div id="categories-tree-select-laptops-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-laptops"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="laptops"
aria-label="Select Laptops"
data-select-row="laptops"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-15!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 3: </span>Laptops</span>
</div>
</th>
<td class="text-right">38</td>
<td class="text-right">220</td>
</tr>
<tr data-row="desktops" data-level="3" data-parent="computers" hidden>
<td class="w-12">
<div id="categories-tree-select-desktops-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-desktops"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="desktops"
aria-label="Select Desktops"
data-select-row="desktops"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-15!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 3: </span>Desktops</span>
</div>
</th>
<td class="text-right">26</td>
<td class="text-right">190</td>
</tr>
<tr data-row="audio" data-level="2" data-parent="electronics" hidden>
<td class="w-12">
<div id="categories-tree-select-audio-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-audio"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="audio"
aria-label="Select Audio"
data-select-row="audio"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-9!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 2: </span>Audio</span>
</div>
</th>
<td class="text-right">78</td>
<td class="text-right">770</td>
</tr>
<tr data-row="accessories" data-level="1">
<td class="w-12">
<div id="categories-tree-select-accessories-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-accessories"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="accessories"
aria-label="Select Accessories"
data-select-row="accessories"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<button
type="button"
aria-expanded="false"
aria-label="Show or hide Accessories"
data-node="accessories"
class="inline-flex shrink-0 items-center justify-center size-7 text-dominant-700 dark:text-dominant-200 rounded cursor-pointer group hover:bg-dominant-200 dark:hover:bg-dominant-700 hover:text-dominant-900 dark:hover:text-white focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<i
aria-hidden="true"
class="text-xs transition-transform duration-150 fa-solid fa-chevron-right motion-reduce:transition-none group-aria-expanded:rotate-90"
></i></button
><span><span class="sr-only">Level 1: </span>Accessories</span>
</div>
</th>
<td class="text-right">96</td>
<td class="text-right">2,040</td>
</tr>
<tr data-row="mice" data-level="2" data-parent="accessories" hidden>
<td class="w-12">
<div id="categories-tree-select-mice-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-mice"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="mice"
aria-label="Select Mice"
data-select-row="mice"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-9!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 2: </span>Mice</span>
</div>
</th>
<td class="text-right">31</td>
<td class="text-right">860</td>
</tr>
<tr data-row="keyboards" data-level="2" data-parent="accessories" hidden>
<td class="w-12">
<div id="categories-tree-select-keyboards-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-keyboards"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="keyboards"
aria-label="Select Keyboards"
data-select-row="keyboards"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-9!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 2: </span>Keyboards</span>
</div>
</th>
<td class="text-right">65</td>
<td class="text-right">1,180</td>
</tr>
<tr data-row="storage" data-level="1">
<td class="w-12">
<div id="categories-tree-select-storage-field" class="group/field">
<div class="flex items-start gap-3">
<span class="relative flex shrink-0 mt-0.5 size-5">
<input
id="categories-tree-select-storage"
class="size-5 shrink-0 appearance-none bg-white dark:bg-dominant-950 rounded inset-ring inset-ring-dominant-500 dark:inset-ring-dominant-400 cursor-pointer peer checked:bg-primary-600 dark:checked:bg-primary-400 checked:inset-ring-primary-600 dark:checked:inset-ring-primary-400 indeterminate:bg-primary-600 dark:indeterminate:bg-primary-400 indeterminate:inset-ring-primary-600 dark:indeterminate:inset-ring-primary-400 focus-visible:ring-2 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 dark:focus-visible:ring-offset-dominant-900 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:inset-ring-danger-600 dark:aria-invalid:inset-ring-danger-400"
value="storage"
aria-label="Select Storage"
data-select-row="storage"
type="checkbox"
/>
<i
aria-hidden="true"
class="absolute inset-0 hidden items-center justify-center !w-full text-xs text-white dark:text-dominant-950 pointer-events-none fa-solid fa-check peer-checked:flex peer-indeterminate:flex peer-indeterminate:[--fa:'\f068'] peer-disabled:opacity-50"
>
</i>
</span>
</div>
</div>
</td>
<th scope="row" class="pr-4 pl-3!">
<div class="flex items-center gap-2">
<span aria-hidden="true" class="shrink-0 size-7"></span
><span><span class="sr-only">Level 1: </span>Storage</span>
</div>
</th>
<td class="text-right">54</td>
<td class="text-right">530</td>
</tr>
</tbody>
<tfoot></tfoot>
</table>
</div>
</div>
Options reference
The props of sk-tree-table, the fields of a row, and the events of lazy rows. Every attribute that is not a prop goes to the <table>.
| Name | Kind | Meaning |
|---|---|---|
fields
|
Prop |
The columns, { key, text, align, sticky, format }; the first one is the tree column.
|
data
|
Prop |
A flat list of rows: id, parent, icon, lazy, and the column values by key.
|
selectable, expand-actions
|
Flags |
The checkboxes with the status, and the Expand alland Collapse allbuttons. |
caption, variant, density, sticky-header, sticky-footer, striped, hover, bordered
|
Props | The look, as on the Tables page. |
tree-load
|
Event from the table |
A lazy row opened for the first time: detail.id.
|
tree-loaded, tree-failed
|
Events to the table |
The children of detail.id were added, or could not be loaded.
|