Table

A data table for list screens: declarative vig-col columns, client-side or lazy sorting (one column or several), typed column filters and a global search, pagination, virtual scrolling, selection, cell editing, row reordering, column visibility, resizing, reordering and frozen columns, CSV export, persisted state, custom cells, expandable rows, sticky headers and loading and empty states.

  • vig-table
  • vig-col
  • [vigTableCell]
  • [vigTableEmpty]
  • [vigTableRowExpansion]
  • [vigTableCellEditor]
  • vig-table-column-toggle
Import
import { Table, TableColumn, TableCell } from '@vigdx/ui/table';

Basic

Pass rows as items and declare one vig-col per column; field names the property to show. Always give the table a caption — it names the table for screen readers.

Recent payments
Invoice Customer Region Amount
1042 Deniz Aksoy Europe 1250
1041 Aylin Kaya Europe 89
1040 Can Demir Asia 430
1039 Mia Wong Asia 2210
1038 Lucas Martin Europe 64.5

Sorting

Mark columns sortable and two-way bind [(sort)] to read or preset the order. sortIndicator="active" shows only the sorted column's arrow.

Payments
Deniz Aksoy 2026-03-02 1250
Aylin Kaya 2026-03-01 89
Can Demir 2026-02-27 430
Mia Wong 2026-02-25 2210
Lucas Martin 2026-02-24 64.5
Sofia Rossi 2026-02-20 980

Sorted by date desc

Filtering

Give a column a filter and the table adds a filter row: filter="text" (also number , date , boolean ) or a typed config such as { type: "select", options } . Bind [(filters)] to read or preset them; typed text and numbers apply after delay (300 ms) and the result count is announced politely. Date filters compare local calendar days; for date-only API values such as 2024-01-05T00:00:00Z , give the column a value accessor returning the local day. Objects in a select filter compare by identity unless the config sets compareWith .

Payments
Customer Status Amount Date

Filter Status

Deniz Aksoy paid 1250 2026-03-02
Aylin Kaya pending 89 2026-03-01
Can Demir paid 430 2026-02-27
Mia Wong failed 2210 2026-02-25
Lucas Martin paid 64.5 2026-02-24
Sofia Rossi paid 980 2026-02-20
Omar Haddad pending 150 2026-02-18
Emma Johnson paid 3120 2026-02-15
Kenji Sato failed 47 2026-02-11
Ana Silva paid 615 2026-02-09
Noah Smith paid 288 2026-02-04
Zeynep Arslan pending 1999 2026-02-01

Filter menu

filterDisplay="menu" puts a filter button in each filterable header. Its menu offers the match mode, up to rules rules joined by "Match all" or "Match any", and Apply and Clear. An active filter shows a filled glyph and says so in the button name.

Payments
Deniz Aksoy 1250 2026-03-02
Aylin Kaya 89 2026-03-01
Mia Wong 2210 2026-02-25
Lucas Martin 64.5 2026-02-24
Sofia Rossi 980 2026-02-20
Emma Johnson 3120 2026-02-15
Kenji Sato 47 2026-02-11
Ana Silva 615 2026-02-09
Zeynep Arslan 1999 2026-02-01

[toolbar]="{ search: true }" renders a labelled search field bound to [(globalFilter)] , which searches every visible column (or globalFilterFields ). Matching is case- and accent-insensitive in the active locale, with Turkish dotted and dotless i handled. Values are searched as text: numbers as written, dates as their local day ( 2024-01-05 ); for what a cell template shows, use a value accessor.

Payments
Customer Region Status
Deniz Aksoy Europe paid
Aylin Kaya Europe pending
Can Demir Asia paid
Mia Wong Asia failed
Lucas Martin Europe paid
Sofia Rossi Europe paid
Omar Haddad Africa pending
Emma Johnson Americas paid
Kenji Sato Asia failed
Ana Silva Americas paid
Noah Smith Americas paid
Zeynep Arslan Europe pending

Search: ""

Computed columns

A typed [value] accessor replaces row[field] for display, sorting, filtering, search and CSV — no string paths. field then only names the column.

Payments with tax

Deniz Aksoy 1500
Aylin Kaya 106.8
Can Demir 516
Mia Wong 2652
Lucas Martin 77.4
Sofia Rossi 1176

Multi-column sort

sortMode="multiple" : Shift+click or Shift+Enter adds a column after the others — or, without modifiers, the "Add … to sort" button that appears when tabbing past a header — the headers show each priority and a third press removes a column. aria-sort stays on the first column and the status reads the whole order. [(sorts)] holds the order; sort mirrors its first entry, and writing sort sorts by that column alone.

Payments
Africa pending 150
Americas paid 3120
Asia failed 2210
Asia paid 430
Europe paid 1250
Europe paid 980
Europe pending 89
Europe paid 64.5

Shift+click a header to add it. Order: region asc, amount desc

Column visibility

[toolbar]="{ columns: true }" adds a Columns menu; hidden columns start hidden and [(columnVisibility)] holds the choice by column field (columns without one always show). The row header column always stays. A filter on a hidden column keeps applying, and the table then shows "Filters on hidden columns" with a Clear button. vig-table-column-toggle [table] places the same menu anywhere else.

Payments
Customer Amount Status Date
Deniz Aksoy 1250 paid 2026-03-02
Aylin Kaya 89 pending 2026-03-01
Can Demir 430 paid 2026-02-27
Mia Wong 2210 failed 2026-02-25
Lucas Martin 64.5 paid 2026-02-24

Column resizing

resizableColumns adds a resize handle to each header with a field : drag it, or Tab to it (one more Tab stop per resizable header) and press ArrowLeft/ArrowRight (Shift for 50px steps, Home/End for the limits). The Columns menu, shown by default then, adds Narrower/Wider buttons per column and Reset widths: the way to resize without dragging. columnResizeMode="fit" (default) keeps the table width: the next resizable column of the same frozen group gives or takes the difference, else the flexible column — the last scrolling column, which has no handle and takes whatever width is left, so the layout follows the container and saved widths shrink to fit a narrower screen. expand grows the table, which then scrolls. minWidth / maxWidth (px, 48 and unlimited by default) bound a column and vig-col [resizable] opts single columns in or out. A drag shows live and is kept on release (keys once they pause): only then columnResized reports { field, width, widths } and state saves the widths, which it ignores while no column is resizable. From the first resize on, the table lays out at the set widths ( table-layout: fixed ) and cuts overflowing cell text.

Payments
Customer Region Status Amount
Deniz Aksoy Europe paid 1250
Aylin Kaya Europe pending 89
Can Demir Asia paid 430
Mia Wong Asia failed 2210

Drag a header edge, or Tab to it and press the arrow keys.

Column reordering

reorderableColumns lets users drag a header (a long press on touch screens, so a swipe still scrolls) — and, as the keyboard and screen-reader way, the Columns menu gains "Move left" and "Move right" buttons per column (the menu shows by default then; [toolbar]="{ columns: false }" hides it when you place a vig-table-column-toggle elsewhere). Each move is announced ("Region moved to position 1 of 4"), columnReordered reports { field, from, to, order } and state keeps the order. Columns without a field stay in place; CSV export follows the order.

Payments
Customer Region Status Amount
Deniz Aksoy Europe paid 1250
Aylin Kaya Europe pending 89
Can Demir Asia paid 430
Mia Wong Asia failed 2210

Frozen columns

frozen="start" or "end" on a vig-col keeps it in view while the table scrolls horizontally: logical, so RTL just works. Frozen columns render first (with the selection and expansion columns) or last, each sticky at the summed width of the ones before it — offsets follow resizing and hiding live — with a line on the boundary. They reorder only among themselves; a bare frozen attribute means start . Their cells are opaque — the row's hover, stripe and selection fill over --color-table-surface (the background by default: set it when the table sits on another surface) — and draw their own row line. They are marked data-frozen="start|end" for styling.

Payments
Customer Invoice Region Date Status Amount
Deniz Aksoy 1042 Europe 2026-03-02 paid 1250
Aylin Kaya 1041 Europe 2026-03-01 pending 89
Can Demir 1040 Asia 2026-02-27 paid 430
Mia Wong 1039 Asia 2026-02-25 failed 2210
Lucas Martin 1038 Europe 2026-02-24 paid 64.5
Sofia Rossi 1037 Europe 2026-02-20 paid 980
Omar Haddad 1036 Africa 2026-02-18 pending 150
Emma Johnson 1035 Americas 2026-02-15 paid 3120
Kenji Sato 1034 Asia 2026-02-11 failed 47
Ana Silva 1033 Americas 2026-02-09 paid 615
Noah Smith 1032 Americas 2026-02-04 paid 288
Zeynep Arslan 1031 Europe 2026-02-01 pending 1999

Cell editing

Mark columns editable (they need a field ) and the table becomes an APG editable grid: one Tab stop, arrow keys move between cells. Enter, F2, a double click or typing a character edits a cell; Enter commits and keeps focus on the cell (the APG grid behaviour, not a spreadsheet jump down, so a screen reader hears where it is), Tab and Shift+Tab commit and edit the next or previous editable cell, Escape cancels, and leaving the cell commits. Typing starts an edit with that character (AltGr and Option characters too); dead keys and IME input do not, so those users press Enter, F2 or double-click. Number cells get a number editor ( editType="number" also for cells that are empty yet, committing number | null ; unset, the value's type decides) that accepts digits of any script, a leading minus and only the locale's decimal separator: no grouping separators, so in a comma-decimal locale such as de 1.234 is rejected rather than guessed. [validate]="cellValidator((value: number | null, row: Payment) => …)" (a typed helper; (value, row) => string | null ) keeps an invalid value in the editor, aria-invalid and described by its error, which is announced; starting another edit meanwhile brings focus back to it instead of dropping what was typed. A vigTableCellEditor template replaces the input: [vigTableCellEditor]="statusOf" types let-value and let-row ; bind ariaLabel , call change(value) as the value changes (Enter, Tab and leaving commit it) or commit(value) for controls that finish on their own, and cancel() . The table never changes your rows: cellEdited reports { row, field, value, previousValue } and you replace the row in a new array. Give the table a rowId : it is how the table recognises the replaced row (without one it follows the row's position, with a dev-mode warning). An edit whose row leaves the screen (new data without it, a filter) or whose column is hidden or made read-only ends without committing. Saving to a server: update optimistically and put the old value back if the request fails. Editing works in tree tables (Enter or F2 on a cell), virtual tables (the edited row stays rendered), frozen columns and sorted tables (focus follows the row to its new place).

Payments
Customer Region Status Amount
Deniz Aksoy Europe paid 1250
Aylin Kaya Europe pending 89
Can Demir Asia paid 430
Mia Wong Asia failed 2210
Lucas Martin Europe paid 64.5

Row reordering

reorderableRows adds a move handle to every row: drag it (a long press on touch screens), press Alt+ArrowUp or Alt+ArrowDown on it (Alt+Home and Alt+End to the ends), or click it for a menu with Move up, Move down, Move to top and Move to bottom, the way to move rows with a single pointer or a screen reader. In an editable grid the Alt keys work on any cell. Each move is announced ("Plan moved to position 3 of 5") and focus stays on the handle. rowReordered reports { row, from, to, items } with indexes in items and the new array: set items to it. Rows move in items order among the rows passing the filters (filtered-out rows keep their places; with the paginator the table follows a row to its page), so moving is off while the table is sorted or loading. A virtual table moves rows with the keys and the menu only (a dev-mode warning says dragging is off); tree tables do not move rows. With groupBy the keys and the menu move a row within its group (dragging is off there, and with row expansion). A move is announced once your new items show it; a move you do not apply is not announced.

Payment queue
Move row Customer Region Amount
Deniz Aksoy Europe 1250
Aylin Kaya Europe 89
Can Demir Asia 430
Mia Wong Asia 2210
Lucas Martin Europe 64.5

Last move: none yet

CSV export

exportCsv() downloads every row passing the filters, in the current order, from the visible columns, and returns the text. Options: filename , includeHidden , selectionOnly , separator , bom and sanitize , which by default neutralises spreadsheet formulas (OWASP CSV injection). toCsv(rows, columns) is the same serialiser as a pure function.

Payments
Customer Amount Status

Deniz Aksoy 1250 paid
Aylin Kaya 89 pending
Can Demir 430 paid
Mia Wong 2210 failed

Persisted state

state="orders" keeps sort, filters, page, page size, column visibility, column widths and order, and expanded rows in localStorage; { key, storage, exclude, migrate } picks session , url or a custom TableStateStorage , leaves parts out (e.g. exclude: ['globalFilter'] ) and converts older payloads. Web Storage keys are namespaced vig-table:<key> ; dates are saved as calendar days and object filter values are not saved. Privacy: with url storage, filter text lands in the address bar, history, server logs and Referer headers. Restored filters, sorts and match modes are validated against the columns. The state is restored in the browser right after the first render, so server-rendered pages hydrate without a mismatch (the restored view shows one frame later).

Payments
Status
Deniz Aksoy 1250 paid
Aylin Kaya 89 pending
Can Demir 430 paid
Mia Wong 2210 failed

Server-side data

Server mode is one line: feed lazyState() into resource() . It carries paging, sort, sorts , filters and globalFilter — the same shape the client mode uses — and only changes when one of them does.

Payments
Deniz Aksoy 1250 Europe
Aylin Kaya 89 Europe
Can Demir 430 Asia
Mia Wong 2210 Asia

Gridlines, stripes and paginator placement

gridlines adds column lines, striped alternate fills; paginatorOptions places the paginator at the start , the end (default) or both , and adds a jump-to-page field.

Payments
Invoice Customer Amount
1042 Deniz Aksoy 1250
1041 Aylin Kaya 89
1040 Can Demir 430
1039 Mia Wong 2210

Selection

selectionMode="multiple" adds a checkbox column with select-all; bind [(selection)] and give rowId so selections survive new row objects. Mark the naming column rowHeader so each checkbox reads "Select row" plus that row's name.

Payments
Customer Status Amount
Deniz Aksoy paid 1250
Aylin Kaya pending 89
Can Demir paid 430
Mia Wong failed 2210
Lucas Martin paid 64.5

0 of 5 selected

Pagination

paginator slices the rows client-side; rows and rowsPerPageOptions set the page size. For server data set lazy with totalRecords and load on lazyLoad .

All payments
1042 Deniz Aksoy 1250
1041 Aylin Kaya 89
1040 Can Demir 430
1039 Mia Wong 2210
1038 Lucas Martin 64.5

Custom cells

An ng-template vigTableCell inside a column renders any content; let-row is the row, let-i="rowIndex" its index. Import TableCell , or the template is silently ignored.

Payments
Customer Status Amount Actions
Deniz Aksoy paid €1,250.00
Aylin Kaya pending €89.00
Can Demir paid €430.00
Mia Wong failed €2,210.00
Lucas Martin paid €64.50

Row expansion

A vigTableRowExpansion template adds a labelled toggle per row and renders under expanded rows. Bind [(expandedRows)] and narrow with rowExpandable . For rows that expand into child rows, see the tree table: rowChildren .

Payments
Expand row Customer Status Amount
Deniz Aksoy paid 1250

Invoice #1042 for Deniz Aksoy (Europe), settled on 2026-03-02.

Aylin Kaya pending 89
Can Demir paid 430
Mia Wong failed 2210
Lucas Martin paid 64.5

Sticky header and scrolling

stickyHeader with a scrollHeight keeps the header in view while the body scrolls; the scroll region (also a too-wide table) is keyboard reachable and named by the caption.

Payment history
Invoice Customer Date Amount
1042 Deniz Aksoy 2026-03-02 1250
1041 Aylin Kaya 2026-03-01 89
1040 Can Demir 2026-02-27 430
1039 Mia Wong 2026-02-25 2210
1038 Lucas Martin 2026-02-24 64.5
1037 Sofia Rossi 2026-02-20 980
1036 Omar Haddad 2026-02-18 150
1035 Emma Johnson 2026-02-15 3120
1034 Kenji Sato 2026-02-11 47
1033 Ana Silva 2026-02-09 615
1032 Noah Smith 2026-02-04 288
1031 Zeynep Arslan 2026-02-01 1999

Virtual scrolling

virtualScroll renders only the rows in view (and a few around them), here 100,000. virtualScroll="auto" gives the table the same layout at any size but windows the rows only from 200 ( TABLE_VIRTUAL_THRESHOLD ), and again renders them all below 150, so crossing the threshold changes no layout. Every row has one height, the median pitch of rendered rows, measured again when the font, density or pointer changes (deep in the table, the row at the top stays in place). Cells, group headers and error rows therefore stay on one line: long text ends in an ellipsis, plain cells show it in full as a title, and screen readers read it whole. The table uses table-layout: fixed , so column widths come from the header and do not jump while rows come and go: give columns a sufficient width ; the others share the rest, each at least --vig-table-column-min-width (8rem), below which the table scrolls sideways. The header is sticky and the body scrolls within the --vig-table-height token (24rem; scrollHeight wins). The focused row stays rendered wherever the view goes. Sorting, filtering and paging go back to the first row; scrollToIndex(i) and scrollToRow(row) jump to a row without moving focus. Selection, select-all and groupBy work on every row; with the paginator it renders the page's rows. Tables with a vigTableRowExpansion template (rows of differing height) render every row, with a dev-mode warning.

All payments
Customer Region
1Deniz AksoyEurope0
2Aylin KayaEurope2919
3Can DemirAsia838
4Mia WongAsia3757
5Lucas MartinEurope1676
6Sofia RossiEurope4595
7Omar HaddadAfrica2514
8Emma JohnsonAmericas433
9Kenji SatoAsia3352
10Ana SilvaAmericas1271
11Noah SmithAmericas4190
12Zeynep ArslanEurope2109
13Deniz AksoyEurope28
14Aylin KayaEurope2947
15Can DemirAsia866
16Mia WongAsia3785
17Lucas MartinEurope1704
18Sofia RossiEurope4623
19Omar HaddadAfrica2542
20Emma JohnsonAmericas461
21Kenji SatoAsia3380
22Ana SilvaAmericas1299
23Noah SmithAmericas4218
24Zeynep ArslanEurope2137
25Deniz AksoyEurope56
26Aylin KayaEurope2975
27Can DemirAsia894
28Mia WongAsia3813
29Lucas MartinEurope1732
30Sofia RossiEurope4651
31Omar HaddadAfrica2570
32Emma JohnsonAmericas489
33Kenji SatoAsia3408
34Ana SilvaAmericas1327
35Noah SmithAmericas4246
36Zeynep ArslanEurope2165
37Deniz AksoyEurope84
38Aylin KayaEurope3003
39Can DemirAsia922
40Mia WongAsia3841
0 of 100000 selected

Empty state

With no rows the table shows emptyMessage , or a vigTableEmpty template such as an empty state with a next step.

Payments
Customer Amount

No payments yet

Payments you record will be listed here.

Server-side data recipe

The table's whole view state is one typed signal. Hand it to resource() (or httpResource()) and render what comes back:

TypeScript
protected readonly table = viewChild(Table<Order>);

protected readonly page = resource({
  // first, rows, sort, sorts, filters, globalFilter
  params: () => this.table()?.lazyState(),
  loader: ({ params, abortSignal }) =>
    fetch(`/api/orders?state=${encodeURIComponent(JSON.stringify(params))}`, {
      signal: abortSignal,
    }).then((response) => response.json() as Promise<{ rows: Order[]; total: number }>),
});

// <vig-table [lazy]="true" [items]="page.value()?.rows ?? []"
//   [totalRecords]="page.value()?.total" [loading]="page.isLoading()" …>

With state set, the table restores the saved view right after the first render; until then stateReady() is false. Gate the request on it to skip loading the defaults first: params: () => (table.stateReady() ? table.lazyState() : undefined). The lazyLoad output already waits.

Texts and performance

  • Every new text (filter menu, toolbar, result and multi-sort announcements) is a key of the typed labels input, merged over the locale defaults of provideVigdxUi (English and Turkish built in). Visible texts end in …Label, screen-reader-only ones in …AriaLabel, status messages in …Announcement and placeholders in …Placeholder. These keys are optional on VigdxLabels, so a complete labels object written for an earlier version keeps compiling.
  • Client mode filters and sorts in memory with FilterMatcher (also injectable on its own, with register(name, fn) for custom match modes). With 10,000 rows a filter or sort change, including rendering a 25-row page, takes about 50–80 ms in jsdom on a dev machine; use lazy with a server for larger sets.
  • Rendering is what grows with the rows on screen: without a paginator, turn on virtualScroll (or "auto") and the table renders a window of about two screens of rows whatever the data size; scrolling re-renders a few rows at a time. Browsers cap the height of an element — Firefox at about 17.9 million px, Chromium and WebKit at about 33.5 million — so one virtual table holds up to about 400,000 rows of the default height; a dev-mode warning comes from 15 million px. Page or load larger sets from a server.

Styling hooks

Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="table"][data-part="toolbar"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.

Table [data-scope="table"]

Table styling hooks
Part Element data-state
toolbar Row above the table: search and column toggle. —
search The built-in global search field. —
filter-indicator Notice of active filters on hidden columns. —
frame The bordered frame around the table. —
loading The loading overlay. —
scroll The scroll region. —
table The native <table> . —
head The <thead> . —
header-cell A column header <th> ( aria-sort ; data-frozen="start|end" when frozen, like every frozen cell). —
resize-handle The resize handle at the end of a resizable header ( role="separator" , resizableColumns ). dragging
sort The sort button of a sortable header. —
sort-priority The priority number of a column in a multi-sort. —
sort-priority-label The visually hidden text that reads the priority out. —
add-to-sort The control that adds a column to a multi-sort. —
filter-row The row of filter editors ( filterDisplay="row" ). —
filter-trigger A column filter menu button ( filterDisplay="menu" ). —
filter-panel The filter menu form, in a popover panel in the overlay container. —
clear-selection The button that clears a single selection. —
body The <tbody> . —
spacer A virtual table ( virtualScroll ): the aria-hidden row standing in for the rows above or below the rendered ones. —
group-header A group header row ( groupBy ). —
row A data row. selected
row-handle The move handle of a row ( reorderableRows ): drag it, Alt+ArrowUp/ArrowDown on it, or click it for its move menu. —
select The selection checkbox or radio of a row. —
select-all The header checkbox that selects every row of the page (multiple selection). —
expand The expand button of a row. —
cell A data cell, <td> or row-header <th> ( data-frozen="start|end" when frozen). editing
editor The default editor of a cell being edited (an editable column). —
editor-error The validation error under a cell editor ( aria-describedby of the editor). —
expansion The detail row of an expanded row. —
toggle The expand button of a tree row ( rowChildren ; aria-expanded , no Tab stop of its own). open, closed
children-loading The busy ring in place of the chevron while a row's children load. —
children-error The row under a tree row whose children failed to load. —
retry The retry button of that row. —
empty The empty-message row. —
paginator A vig-paginator (top and bottom). —

TableColumnToggle [data-scope="table"]

TableColumnToggle styling hooks
Part Element data-state
column-toggle The column visibility menu (on the host). —
column-move-left The "Move left" button of a column ( reorderableColumns ). —
column-move-right The "Move right" button of a column ( reorderableColumns ). —
column-narrow The "Narrower" button of a resizable column. —
column-widen The "Wider" button of a resizable column. —
column-reset-widths The "Reset widths" button (resizable columns). —

Accessibility

  • Renders a native <table> with <th scope="col"> headers; caption becomes a visually hidden <caption>. Mark the column that names each row with <vig-col rowHeader> to render its cells as <th scope="row">.
  • Sortable headers are buttons inside the header cell, and the sorted column carries aria-sort. Each sort is announced through one polite status ("Sorted by Name, ascending"; sortAscendingAnnouncement, sortDescendingAnnouncement).
  • Selection is a native control per row: radios for selectionMode="single" (one group, so the arrow keys move the selection) and checkboxes for multiple, labelled per row (selectRowAriaLabel) and for the whole page (selectAllAriaLabel); a row click is only a pointer shortcut. Like any radio, a single-selection radio only selects; a translatable "Clear selection" button (clearSelectionAriaLabel) in its column header clears it. The controls belong to no form (form=""), so they never submit or post a surrounding form. Expansion toggles expose aria-expanded and aria-controls. With a row header column, the row controls add the row's header to their name ("Select row Alice").
  • Whenever the table can scroll — a capped height or columns wider than the container — its scroll area becomes a focusable role="region" named by the caption (or scrollRegionAriaLabel), so keyboard users can scroll it.
  • A virtual table keeps its table semantics: the table carries aria-rowcount (every row, the header rows included) and each rendered row its aria-rowindex, so screen readers announce "row 5,002 of 100,001". The spacer rows around the window are aria-hidden; with the paginator, positions count every page. Tab moves through the rendered rows' controls and the area scrolls to follow; the row holding focus stays rendered at its own place while the window moves (a scroll, a jump, a sort), so focus never falls back to the page. A sticky header sets the region's scroll-padding-top, which keeps focused rows clear of it.
  • A flat virtual table has no row-to-row keyboard model (a tree table has one): a screen reader's table or browse navigation stops at the edge of the rendered rows until the region scrolls. For screen-reader-heavy screens prefer the paginator, which puts every row of a page in the DOM.
  • A resize handle is an APG window splitter: role="separator" with aria-orientation="vertical", a value in pixels (aria-valuenow/min/max, spoken as "120 pixels", labels.columnWidthAriaLabel) and a name ("Resize Name column", labels.resizeColumnAriaLabel). It adds one Tab stop per resizable header; ArrowLeft and ArrowRight (mirrored in RTL) resize by 10px, with Shift by 50px, Home and End jump to the limits. Its hit area is 24px wide (44px on coarse pointers). The header is named by its content through aria-labelledby, so cells never read the handle's name. Pointer drags capture the pointer; only the handle sets touch-action: none. Dragging is never the only way: the Columns menu's Narrower, Wider and Reset widths buttons (labels.narrowColumnAriaLabel, widenColumnAriaLabel, resetColumnWidthsLabel) work with a single pointer (WCAG 2.5.7), and their changes are announced (columnResizedAnnouncement, columnWidthsResetAnnouncement).
  • Column reordering has a keyboard and screen-reader path besides dragging: the Move left and Move right buttons of the Columns menu (labels.moveColumnLeftAriaLabel, moveColumnRightAriaLabel). Focus stays on the button that moved the column, and every move is announced through the table's polite status (labels.columnMovedAnnouncement).
  • A flat table with editable columns is an APG editable grid (role="grid", named by the caption): one Tab stop on a cell (a roving tabindex), arrow keys between cells (mirrored in RTL), Home/End, Ctrl+Home/End and PageUp/PageDown; keys with no cell in their direction are left to the browser. The row's own controls (selection, expansion, move handle) and the controls of cell templates are no Tab stops of their own there, so the grid is one Tab stop: Enter or Space on a row control's cell presses it, Enter or F2 moves into a cell template's controls, Escape back. Cells the grid does not edit carry aria-readonly. Detail rows (vigTableRowExpansion) are no grid rows: the arrow keys pass them by, and their controls keep their own Tab stops. Cells draw an outline focus ring, kept in forced colors. In a tree table, cells keep the treegrid's keys and Enter or F2 edits.
  • The default editor is a native input named "Edit Name, row 3" (labels.editCellAriaLabel), at least 16px on touch screens so iOS does not zoom. An invalid value sets aria-invalid and aria-describedby on it and announces the error; commits ("Name changed", labels.cellEditedAnnouncement) and cancels (labels.editCancelledAnnouncement) are announced through the table's polite status. Focus returns to the cell on Enter, Escape and a custom editor's commit, and stays on the edited row's cell when the edit moves it in the sort order.
  • Each row's move handle is a button named "Move row" plus the row header ("Move row Alice", labels.moveRowAriaLabel) with aria-haspopup="menu" and aria-keyshortcuts; its hit area is 24px (44px on coarse pointers) and only it sets touch-action: none. Its menu (labels.moveRowUpLabel, moveRowDownLabel, moveRowTopLabel, moveRowBottomLabel) is the single-pointer alternative to dragging (WCAG 2.5.7); in a grid, closing it returns focus to the handle's cell. A move is announced once the rows show it, half a second later (labels.rowMovedAnnouncement), after the moved handle got its focus back, so the announcement is not lost. The CDK drag machinery exists only while rows can be dragged, joins no surrounding cdkDropListGroup and lets no other item in.
  • Frozen cells never rely on color: their boundary is a border (kept in forced colors), and their opaque fills come from tokens. The scroll area is an isolated stacking context (isolation: isolate): frozen cells at z-index: 1 and the sticky header at 10 stack inside it (the loading cover at 20 above it), never against the page's own sticky bars, and overlays use the top layer. A dragged header's placeholder is outlined as well as faded, for forced colors. Header dragging creates its CDK drag machinery only while reorderableColumns is on (no document touch listener otherwise) and joins no surrounding cdkDropListGroup.
  • Filter editors are labelled ("Filter Customer") and live in a data row of the header, so they never become headers of the body cells. The filter menu is a named non-modal dialog: focus moves into it, Escape and Apply return focus to its button, and the button names an active filter ("Filter Amount (filtered)") besides showing a filled glyph — never color alone. Filtered result counts are announced once, debounced, through the table's single polite status.
  • Multi-sort keeps aria-sort on the first sorted column only; the others carry a visually hidden priority ("sort priority 2"), and the status reads the whole order.
  • While loading, the table is aria-busy and shows a vig-spinner named loadingAriaLabel. Every built-in label is an input for i18n.

API

Table

vig-table component

Data table for the backoffice list screens: client-side or lazy (server-side) sorting — by one column or several (sortMode="multiple") — column filters (columns with a filter, as a filter row or filter menus) and a global filter, pagination, checkbox or radio selection (a row click selects too), group subheaders, expandable rows, column visibility, CSV export, persisted state (state), loading and empty states. With rowChildren (or loadChildren) it becomes a tree table: the items are the root rows and the table an APG treegrid. virtualScroll renders only the rows in view, for tens of thousands of rows. Columns can be resized (resizableColumns), reordered (reorderableColumns) and frozen (vig-col frozen), also in a virtual table. Cells of editable columns are edited in place (cellEdited), and reorderableRows lets users move rows (rowReordered); the table never changes your items itself.

resize-handle dragging

Table props
Name Type Default Description
captionstring | undefinedundefined

Accessible table name, rendered as a visually hidden caption.

cascadebooleantrue

Tree table with selectionMode="multiple": checking a row checks its selectable descendants, and a parent shows checked, unchecked or mixed from them; selection lists every checked row, implied ones included (a parent set from outside, children loaded under a checked row are written back into it). Rows that rowSelectable rejects keep their own state and pass the cascade through. Off, every checkbox stands alone.

clearSelectionAriaLabelstring | undefinedundefined

Name of the single-selection column's clear button (i18n).

collapseRowAriaLabelstring | undefinedundefined
—
columnResizeModeTableColumnResizeMode'fit'

fit (default) keeps the table width: the next column gives or takes the difference. expand changes the table width, which then scrolls.

columnVisibility model Readonly<Record<string, boolean>>—

Visibility per column field, over each column's hidden.

emptyMessagestring | undefinedundefined
—
expandedRows model T[][]

Expanded rows of a table with a vigTableRowExpansion template, or the expanded parent rows of a tree table (rowChildren); identity via rowId.

expandRowAriaLabelstring | undefinedundefined
—
filterDisplayTableFilterDisplay'row'

row: a filter row under the header; menu: a filter button per header opening a menu.

filters model TableFilters—

Column filters by column field; written by the filter UI, settable from outside.

first model number0
—
globalFilter model string''

Text searched (contains) in every visible column, or in globalFilterFields.

globalFilterFieldsreadonly string[] | undefinedundefined

Column fields the global filter searches; every visible column with a field by default.

gridlinesbooleanfalse

Lines between columns as well as rows.

groupBystring | undefinedundefined

Inserts a subheader row whenever this property's value changes.

itemsreadonly T[][]
—
labelsPartial<TableLabels>—

Texts of the filter UI, multi-sort, toolbar and result status (i18n); locale defaults.

lazybooleanfalse

Rows are already paged/sorted by the server; state changes emit lazyLoad.

loadChildrenTableChildrenLoader<T> | undefinedundefined

Fetches the children of rows whose rowChildren is undefined on their first expand (makes the table a tree table on its own too); see TableChildrenLoader. Collapsing a loading row, or another loader, cancels the request; a failed load shows a retry row.

loadingbooleanfalse
—
loadingAriaLabelstring | undefinedundefined
—
paginatorbooleanfalse

Renders the embedded paginator and (non-lazy) slices the rows.

paginatorLabelsPaginatorLabels—
—
paginatorOptionsTablePaginatorOptions—

Paginator placement (position) and its jump-to-page field.

paginatorReportPositionPaginatorReportPosition'start'
—
paginatorSizePaginatorSize'sm'
—
reorderableColumnsbooleanfalse

Lets users reorder the columns with a field: drag a header (a long press on touch screens), or use the move buttons of the column menu, which then shows by default (toolbar.columns). The order is kept with state.

reorderableRowsbooleanfalse

Lets users move rows: drag a row by its handle (a long press on touch screens), press Alt+ArrowUp/ArrowDown (Alt+Home/End) on the handle or a cell, or pick a move from the handle's menu. Moves are announced and reported as rowReordered; set items to its items. Rows move in the order of items among the rows passing the filters, so moving is off while the table is sorted (or loading). A virtual table moves rows by keyboard and menu only; tree tables do not move rows.

resizableColumnsbooleanfalse

Adds a resize handle to the header of every column with a field (vig-col resizable opts single columns in or out): drag it, or focus it and use the arrow keys. Widths are kept with state.

rowChildrenTableChildrenAccessor<T> | undefinedundefined

Makes the table a tree table: the children of a row, e.g. (f: FileRow) => f.children. items are the root rows; your row objects stay as they are. [] or null marks a leaf, undefined a row whose children loadChildren fetches (a leaf without a loader).

The table then is an APG treegrid: a toggle in the row-header column (else the first column) expands rows (expandedRows), rows are one Tab stop moved by the arrow keys, sorting orders siblings within their parent, filters keep matching rows with their ancestors (shown expanded) and descendants, and the paginator pages the root rows. Row expansion templates and groupBy do not apply to tree tables.

rowExpandable((row: T) => boolean) | undefinedundefined

Which rows get an expansion toggle; every row when unset.

rowHoverbooleanfalse

Pointer feedback (hover fill + cursor) for rowClick-driven tables.

rowId((row: T) => unknown) | undefinedundefined

Row identity for selection and tracking, e.g. (u) => u.id.

rows model number10
—
rowSelectable((row: T) => boolean) | undefinedundefined

Which rows can be selected; every row when unset. The others show a disabled checkbox or radio with their own state, and a row click or the header checkbox leaves them as they are.

rowsPerPageOptionsreadonly number[][]
—
scrollHeightstring | undefinedundefined

Max height of the scrolling body area, any CSS length, e.g. 24rem or 60vh.

scrollRegionAriaLabelstring | undefinedundefined

Name of the scroll region when there is no caption.

selectAllAriaLabelstring | undefinedundefined
—
selection model T[][]

Selected rows; holds at most one entry in single mode.

selectionMode"none" | "single" | "multiple"'none'

single adds a radio column and multiple a checkbox column, named by the row header (rowHeader) or selectRowAriaLabel: native controls expose the selection to assistive tech and keyboards, which aria-selected on a plain table row does not. A row click also toggles the selection; in single mode the column header offers a clear button (clearSelectionAriaLabel). The controls belong to no form (form=""), so they are never submitted with, nor submit, a surrounding form.

selectRowAriaLabelstring | undefinedundefined
—
sizeTableSize'md'

Row density: vertical cell padding of the body rows.

sort model TableSort | nullnull

The sorted column; in multiple mode the one with the highest priority.

sortAscendingAnnouncementstring | undefinedundefined

Status announced after an ascending sort; {0} is the column header.

sortDescendingAnnouncementstring | undefinedundefined

Status announced after a descending sort; {0} is the column header.

sortIndicatorTableSortIndicator'always'

always marks every sortable header with a faint sort glyph; active shows only the sorted column's arrow and reveals the glyph of the others on hover or keyboard focus.

sortMode"single" | "multiple"'single'

multiple sorts by several columns: Shift+click (or Shift+Enter, Ctrl/Cmd+click) on a header adds it after the others, headers show each column's priority, and a third press removes a column's sort. A plain click sorts by that column alone.

sorts model TableSort[][]

Every sorted column in priority order: the source of truth in sortMode="multiple", where sort mirrors its first entry. Writing sort from outside in multiple mode sorts by that column alone.

stateTableStateOptions | undefinedundefined

Keeps sort, filters, page, page size, column visibility and expanded rows across visits: a storage key (localStorage), or { key, storage }. Restored in the browser right after the first render — never on the server, so hydration matches — and read once.

stickyHeaderbooleanfalse

Keeps the header row in view while the body scrolls (set scrollHeight too).

stripedbooleanfalse

Alternating row fills.

toolbarTableToolbar—

Built-in controls above the table: { search: true, columns: true }.

totalRecordsnumber | undefinedundefined

Total row count on the server (lazy mode).

virtualScrollTableVirtualScrollfalse

Renders only the body rows in view (and a few around them), for large flat or tree tables: true, or 'auto', which windows the rows from TABLE_VIRTUAL_THRESHOLD rows on. Either value gives the table its virtual layout at any row count, so crossing the threshold changes no layout: the body scrolls within scrollHeight, else the --vig-table-height token (24rem); the header is sticky; columns keep their widths while scrolling (table-layout: fixed: give columns a width, the others share the rest, at least --vig-table-column-min-width each, and the table scrolls sideways below that); cells stay on one line, ending in an ellipsis, since every row has one measured height (the full text stays in the DOM for screen readers, and plain cells show it as a title). The focused row stays rendered wherever the view goes. With the paginator it renders the page's rows. Does not apply to tables with a vigTableRowExpansion template (a dev-mode warning says so).

TableColumn

vig-col component

Declares one table column. Renders nothing itself — vig-table reads the inputs and the optional cell template:

Example :
<vig-col field="name" header="Name" [sortable]="true" />
<vig-col header="Actions">
  <ng-template vigTableCell let-row let-i="rowIndex">…</ng-template>
</vig-col>
TableColumn props
Name Type Default Description
align"start" | "center" | "end" | "left" | "right"'left'

Text alignment of the column's cells and header. start/end follow the text direction. left/right are deprecated aliases of them: they always aligned logically too (right is the left edge under RTL).

editablebooleanfalse

Lets users edit the column's cells (needs a field, which cellEdited reports): Enter, F2, a double click or typing on a cell opens the default text input (a number input for number values), or the column's vigTableCellEditor template. The table then is an APG grid.

editTypeTableCellEditType | undefinedundefined

The default editor of an editable column: number parses the text in the locale and commits number | null (also from an empty cell), text commits the text. Unset, it follows the cell's value: a number edits as a number, anything else (null too) as text.

fieldstring | undefinedundefined

Property read from the row for display and client-side sorting.

filterTableColumnFilterConfig | undefinedundefined

Makes the column filterable (needs a field): filter="text", or a typed config such as [filter]="{ type: 'select', options: statuses }". Rendered in the filter row or as a filter menu, per the table's filterDisplay.

frozenTableColumnFrozen | undefinedundefined

Keeps the column in view while the table scrolls horizontally, pinned to the inline start (with the selection and expansion columns) or end; logical, so it follows the text direction. Frozen columns render first (or last) and are reordered only among themselves. A bare frozen attribute means start.

headerstring''
—
hiddenbooleanfalse

Starts the column hidden; the column menu or columnVisibility can show it. Needs a field, the column's stable key (header text changes with the language): without one the column stays visible.

maxWidthnumber | undefinedundefined

Widest width a resize gives the column, in px; unlimited by default.

minWidthnumber | undefinedundefined

Narrowest width a resize leaves the column, in px; 48 by default.

resizableboolean | undefinedundefined

Gives the column a resize handle (true) or none (false) whatever the table's resizableColumns; unset, it follows the table. Needs a field, the key its width is kept by.

rowHeaderbooleanfalse

Renders this column's cells as row headers (<th scope="row">), e.g. a name column. They also complete the names of the row's selection checkbox and expand button ("Select row Alice"); the first such column wins.

sortablebooleanfalse
—
validateTableCellValidator | undefinedundefined

Checks an edited value before it is committed: an error message keeps the editor open showing it, null accepts the value.

valueTableValueAccessor | undefinedundefined

Typed accessor of the cell value, e.g. [value]="total" with total = (o: Order) => o.price * o.quantity. Used instead of row[field] for display (without a cell template), sorting, filtering, global search and CSV export; field then only names the column (its key in sort, filters and the persisted state).

widthstring | undefinedundefined

Any CSS width, e.g. '12rem' or '20%'.

TableCellEditor

ng-template[vigTableCellEditor] directive

Marks an ng-template inside an editable vig-col as its cell editor, replacing the default text (or number) input. Bind the context's ariaLabel (and, while invalid, errorId and error) to the control; call change as the value changes, or commit for controls that finish on their own (a select). Enter, Tab and leaving the cell commit what change recorded; Escape cancels. A control that uses Enter or Escape itself (a list it opens) calls preventDefault() on them.

Bind an accessor, e.g. [vigTableCellEditor]="statusOf", to type let-value and let-row; it also reads the value the editor starts from (the column's value accessor or field by default).

Example :
<vig-col field="status" header="Status" editable>
  <ng-template [vigTableCellEditor]="statusOf" let-value let-commit="commit" let-label="ariaLabel">
    <select [attr.aria-label]="label" (change)="commit($any($event.target).value)">…</select>
  </ng-template>
</vig-col>
TableCellEditor props
Name Type Default Description
vigTableCellEditor((row: T) => V) | '' | undefinedundefined

Reads the value the editor starts from; types the template context.

TableColumnToggle

vig-table-column-toggle component

A "Columns" button whose popover lists the columns of a vig-table with a checkbox each, to show or hide them. vig-table renders one itself with [toolbar]="{ columns: true }"; place this component anywhere else (a page toolbar) and hand it the table:

Example :
<vig-table-column-toggle [table]="orders" />
<vig-table #orders …>…</vig-table>

Columns are keyed by field: columns without one, and the row header column (rowHeader), which names the rows and their controls, are not listed; the last visible column cannot be hidden. With reorderableColumns on the table, the menu lists the columns in their order and adds "Move left" and "Move right" buttons to each; with resizable columns, "Narrower" and "Wider" buttons to those and a "Reset widths" button (the row header column is listed then too; it still cannot be hidden). They are the way to reorder and resize without dragging: keyboards, screen readers and single pointers (WCAG 2.5.7).

TableColumnToggle props
Name Type Default Description
labelstring | undefinedundefined

Button label and menu name; tableColumnToggleLabel ("Columns") by default.

table required TableColumnToggleHost—

The table whose columns the menu lists.

FilterMatcher

injectable

Locale-aware, typed row filtering for vig-table and anything else that filters records. Pure apart from the registry: matching never mutates the rows, and the same rows, filters and locale give the same result.

Text modes compare case- and accent-insensitively (Intl.Collator, sensitivity: 'base', for equality; locale-folded text for substrings), so in Turkish istanbul finds İstanbul but not Istanbul, whose lower case is ıstanbul. Number and date modes compare numerically; date modes compare the local calendar day. Add modes with register:

Example :
inject(FilterMatcher).register('even', (value) => Number(value) % 2 === 0);
FilterMatcher methods
Signature Description
filter(rows: readonly T[], filters: TableFilters, options: FilterRowsOptions<T> = {},): readonly T[]

The rows that pass every column filter (keyed by field) and, when set, the global filter (contains) on any of globalFields. Returns the input array itself when nothing filters.

has(mode: string): boolean

Whether mode is a built-in or registered match mode.

match(matchMode: FilterMatchMode, value: unknown, filter: unknown, locale?: string): boolean

Whether value passes one constraint. An empty filter value sets no rule and passes; so does an unknown match mode (with a dev-mode warning), so a stale or crafted filter — e.g. from a shared URL — never breaks a view.

register(name: string, fn: FilterMatchFn): void

Adds a match mode, or replaces one with the same name.

Templates and directives

Templates and directives
Selector Export Description
[vigTableCell]TableCell

Marks an ng-template as a column's custom cell. The explicit marker keeps the query away from the TemplateRefs Angular creates for control-flow blocks (@if/@for) around the template. Like every directive, it only applies when the consuming component imports TableCell — without the import the template is silently ignored and cells render empty.

[vigTableEmpty]TableEmpty

Marks an ng-template as the empty-state content of vig-table.

ng-template[vigTableRowExpansion]TableRowExpansion

Marks an ng-template as the detail content of expandable rows. When present, vig-table adds a leading toggle column and renders the template in a full-width row under every expanded row:

Example :
<ng-template vigTableRowExpansion let-row>{{ row.notes }}</ng-template>
[vigTableGroupHeader]TableGroupHeader

Marks an ng-template as the group subheader; context: group value + first row.

Are you sure?