Surfaces and display
Table
Rows of records with columns to compare. table.kui-table in a .kui-table-wrap; wrapped in <kui-table> its columns sort and its rows can be selected. With --cards each row becomes a card on a phone.
The table is a real <table> with a caption and column heads, so it reads well without JavaScript. The element adds the sort buttons, the selection column and the column names that the phone's cards show.
Examples
Sortable and selectable, cards on a phone
Press a column head to sort; press it again to reverse. Tick rows: the bar above the table shows how many are selected and what can be done with them. Narrow the window under 640 pixels to see each row as a card.
| Client | Invoice | Due | State | Amount, RSD |
|---|---|---|---|---|
| Đorđević d.o.o. | INV-0142 | 3 Dec 2026 | Waiting | 184 500,00 |
| Šumadija Promet | INV-0139 | 20 Nov 2026 | Overdue | 62 000,00 |
| Ana Čolić | INV-0145 | 15 Dec 2026 | Paid | 24 000,00 |
| Zastava Inženjering | INV-0131 | 5 Nov 2026 | Paid | 1 250 000,00 |
<kui-table selectable>
<div class="kui-table__bar">
<span data-count>0 selected</span>
<button class="kui-button kui-button--sm" type="button"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#download"></use></svg><span>Export</span></button>
<button class="kui-button kui-button--sm kui-button--danger" type="button"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#trash-2"></use></svg><span>Delete</span></button>
</div>
<div class="kui-table-wrap" role="region" aria-labelledby="table-cap" tabindex="0">
<table class="kui-table kui-table--cards">
<caption id="table-cap">Invoices, November 2026</caption>
<thead><tr>
<th scope="col" data-sort="text">Client</th>
<th scope="col" data-sort="text">Invoice</th>
<th scope="col" data-sort="date">Due</th>
<th scope="col">State</th>
<th scope="col" class="kui-num" data-sort="number">Amount, RSD</th>
</tr></thead>
<tbody>
<tr><td class="kui-cell-title">Đorđević d.o.o.</td><td>INV-0142</td><td data-value="2026-12-03">3 Dec 2026</td><td><span class="kui-badge kui-badge--warn">Waiting</span></td><td class="kui-num" data-value="184500">184 500,00</td></tr>
<tr><td class="kui-cell-title">Šumadija Promet</td><td>INV-0139</td><td data-value="2026-11-20">20 Nov 2026</td><td><span class="kui-badge kui-badge--danger">Overdue</span></td><td class="kui-num" data-value="62000">62 000,00</td></tr>
<tr><td class="kui-cell-title">Ana Čolić</td><td>INV-0145</td><td data-value="2026-12-15">15 Dec 2026</td><td><span class="kui-badge kui-badge--ok">Paid</span></td><td class="kui-num" data-value="24000">24 000,00</td></tr>
<tr><td class="kui-cell-title">Zastava Inženjering</td><td>INV-0131</td><td data-value="2026-11-05">5 Nov 2026</td><td><span class="kui-badge kui-badge--ok">Paid</span></td><td class="kui-num" data-value="1250000">1 250 000,00</td></tr>
</tbody>
</table>
</div>
</kui-table>
A sticky head in a scrolling table
.kui-table-wrap--sticky gives the table a height; the head stays at the top while its rows scroll. The scrolling region can be focused, so the keyboard scrolls it too.
| Date | Time | Case | Court |
|---|---|---|---|
| 1 Dec | 09:00 | P-1423/2026 | Osnovni sud, Novi Sad |
| 2 Dec | 11:30 | P-0877/2025 | Viši sud, Beograd |
| 3 Dec | 10:00 | Pž-311/2026 | Privredni apelacioni sud |
| 4 Dec | 13:15 | P-2210/2026 | Osnovni sud, Čačak |
| 7 Dec | 09:30 | P-1987/2026 | Osnovni sud, Šabac |
| 8 Dec | 12:00 | P-0412/2026 | Viši sud, Niš |
| 9 Dec | 10:30 | P-1423/2026 | Osnovni sud, Novi Sad |
| 10 Dec | 14:00 | Pž-118/2026 | Privredni sud, Kragujevac |
| 11 Dec | 09:00 | P-3011/2026 | Osnovni sud, Zrenjanin |
| 14 Dec | 11:00 | P-2876/2026 | Osnovni sud, Kraljevo |
| 15 Dec | 10:15 | P-0877/2025 | Viši sud, Beograd |
| 16 Dec | 12:30 | P-1550/2026 | Osnovni sud, Subotica |
| 17 Dec | 09:45 | P-2210/2026 | Osnovni sud, Čačak |
| 18 Dec | 13:00 | Pž-311/2026 | Privredni apelacioni sud |
<div class="kui-table-wrap kui-table-wrap--sticky" role="region" aria-labelledby="table-hearings-cap" tabindex="0">
<table class="kui-table kui-table--compact kui-table--striped">
<caption id="table-hearings-cap">Hearings, December 2026</caption>
<thead><tr><th scope="col">Date</th><th scope="col">Time</th><th scope="col">Case</th><th scope="col">Court</th></tr></thead>
<tbody>
<tr><td>1 Dec</td><td>09:00</td><td>P-1423/2026</td><td>Osnovni sud, Novi Sad</td></tr>
<tr><td>2 Dec</td><td>11:30</td><td>P-0877/2025</td><td>Viši sud, Beograd</td></tr>
<tr><td>3 Dec</td><td>10:00</td><td>Pž-311/2026</td><td>Privredni apelacioni sud</td></tr>
<tr><td>4 Dec</td><td>13:15</td><td>P-2210/2026</td><td>Osnovni sud, Čačak</td></tr>
<tr><td>7 Dec</td><td>09:30</td><td>P-1987/2026</td><td>Osnovni sud, Šabac</td></tr>
<tr><td>8 Dec</td><td>12:00</td><td>P-0412/2026</td><td>Viši sud, Niš</td></tr>
<tr><td>9 Dec</td><td>10:30</td><td>P-1423/2026</td><td>Osnovni sud, Novi Sad</td></tr>
<tr><td>10 Dec</td><td>14:00</td><td>Pž-118/2026</td><td>Privredni sud, Kragujevac</td></tr>
<tr><td>11 Dec</td><td>09:00</td><td>P-3011/2026</td><td>Osnovni sud, Zrenjanin</td></tr>
<tr><td>14 Dec</td><td>11:00</td><td>P-2876/2026</td><td>Osnovni sud, Kraljevo</td></tr>
<tr><td>15 Dec</td><td>10:15</td><td>P-0877/2025</td><td>Viši sud, Beograd</td></tr>
<tr><td>16 Dec</td><td>12:30</td><td>P-1550/2026</td><td>Osnovni sud, Subotica</td></tr>
<tr><td>17 Dec</td><td>09:45</td><td>P-2210/2026</td><td>Osnovni sud, Čačak</td></tr>
<tr><td>18 Dec</td><td>13:00</td><td>Pž-311/2026</td><td>Privredni apelacioni sud</td></tr>
</tbody>
</table>
</div>
States
Every state
Hover: a soft fill on the row. Selected: the accent fill, aria-selected="true" on the row; on a phone the selected card gets the accent line. Sorted: the column’s mark is full and aria-sort says the order. Empty: one row whose cell spans every column and says what to do. Loading: skeletons in the cells and aria-busy="true" on the table.
| State | Amount | |
|---|---|---|
| Default row | – | 1 000,00 |
| Selected row | aria-selected | 2 000,00 |
| Verwaltungsgebührenrückerstattungsantrag | A long word wraps | 12 345 678,90 |
| Client | Invoice | Amount |
|---|---|---|
No invoices this month Invoices you send appear here. | ||
| Client | Invoice | Amount |
|---|---|---|
<div class="kui-stack">
<div class="kui-table-wrap" role="region" aria-labelledby="table-s-cap" tabindex="0">
<table class="kui-table">
<caption id="table-s-cap">Rows in every state</caption>
<thead><tr><th scope="col" aria-sort="ascending"><button class="kui-sort" type="button">Name<span class="kui-sort__mark" aria-hidden="true"></span></button></th><th scope="col">State</th><th scope="col" class="kui-num">Amount</th></tr></thead>
<tbody>
<tr><td>Default row</td><td>–</td><td class="kui-num">1 000,00</td></tr>
<tr aria-selected="true"><td>Selected row</td><td>aria-selected</td><td class="kui-num">2 000,00</td></tr>
<tr><td>Verwaltungsgebührenrückerstattungsantrag</td><td>A long word wraps</td><td class="kui-num">12 345 678,90</td></tr>
</tbody>
</table>
</div>
<div class="kui-table-wrap" role="region" aria-labelledby="table-e-cap" tabindex="0">
<table class="kui-table">
<caption id="table-e-cap">Empty</caption>
<thead><tr><th scope="col">Client</th><th scope="col">Invoice</th><th scope="col" class="kui-num">Amount</th></tr></thead>
<tbody><tr><td colspan="3"><div class="kui-empty"><p class="kui-empty__title">No invoices this month</p><p class="kui-empty__text">Invoices you send appear here.</p></div></td></tr></tbody>
</table>
</div>
<div class="kui-table-wrap" role="region" aria-labelledby="table-l-cap" tabindex="0">
<table class="kui-table" aria-busy="true">
<caption id="table-l-cap">Loading</caption>
<thead><tr><th scope="col">Client</th><th scope="col">Invoice</th><th scope="col" class="kui-num">Amount</th></tr></thead>
<tbody>
<tr><td><span class="kui-skeleton kui-skeleton--text" aria-hidden="true"></span></td><td><span class="kui-skeleton kui-skeleton--text" aria-hidden="true"></span></td><td><span class="kui-skeleton kui-skeleton--text" aria-hidden="true"></span></td></tr>
<tr><td><span class="kui-skeleton kui-skeleton--text" aria-hidden="true"></span></td><td><span class="kui-skeleton kui-skeleton--text" aria-hidden="true"></span></td><td><span class="kui-skeleton kui-skeleton--text" aria-hidden="true"></span></td></tr>
</tbody>
</table>
</div>
</div>
Classes and attributes
.kui-table-wrap- The frame; it scrolls sideways when the table is wider. Give it role="region", a name and tabindex="0".
--sticky- On the wrap: a fixed height; the head stays at the top.
table.kui-table- The table. --compact for tighter rows, --striped for alternate fills.
--cards- Under 640 pixels each row is a card; each cell shows its column’s name.
caption- The table’s name. Always write one.
th[scope="col"], th[scope="row"]- Column heads and row heads.
.kui-num- A number column: right-aligned, tabular figures.
.kui-cell-title- The cell that titles a row’s card on a phone.
td[data-label]- The column name a card shows; kui-table writes it from the head when it is missing.
kui-table- Adds sorting and, with selectable, the selection column.
th[data-sort="text|number|date"]- Makes the column sortable. A cell’s data-value is its sort value.
selectable- On kui-table: a checkbox per row and one for all, and the bar.
.kui-table__bar, [data-count]- Actions for the selected rows; shown while rows are selected, with the count.
kui-sort, kui-selection- Events: detail.column and detail.direction; detail.rows.
Keyboard
- Tab
- Moves to the scrolling region, the sort buttons and the checkboxes.
- Enter or Space
- On a column head, sorts by it; again reverses.
- Space
- On a checkbox, selects or clears the row.
- Arrow keys
- In a focused scrolling region, scroll it.
Accessibility
- A caption names the table; the region around it is named by the caption, so a screen reader announces it once.
- Sortable heads are buttons inside the th; aria-sort on the th says the order and is read with the column.
- Each row checkbox is named after its row (“Select Đorđević d.o.o.”); the head checkbox says “Select all rows” and shows a mixed state.
- The number of selected rows is announced when it changes.
- On a phone the head is hidden only visually; the cards keep their column names from data-label.
Do and do not
Do
- Right-align numbers and give them the same decimals.
- Put the column people sort by most first.
- Say in the empty row what to do next.
Do not
- Do not put a form with many fields in a table row.
- Do not use a table for layout.
- Do not hide columns on a phone without a way to see them.