Data table

Search, sort, select and paginate rows.

Ada Lovelace[email protected]Owner
Grace Hopper[email protected]Admin
Alan Turing[email protected]Member
Edsger Dijkstra[email protected]Member
Linus Torvalds[email protected]Admin
7 row(s)
Page 1 of 2

Toolbar, page size and column visibility

Ada Lovelace[email protected]Owner
Grace Hopper[email protected]Admin
Alan Turing[email protected]Member
Edsger Dijkstra[email protected]Member
Linus Torvalds[email protected]Admin
7 row(s)
Page 1 of 2

API reference

Inputs

PropTypeDefaultDescription
columnsreadonly DataTableColumn[][]Column definitions that drive the headers, cell lookup and sort/search keys.
rowsreadonly DataRow[][]Source data rows; each is a key/value map indexed by column keys.
searchablebooleantrueWhether to show the search box that filters rows across all columns.
searchPlaceholderstring'Search...'Placeholder text for the search input.
selectablebooleantrueWhether to render row checkboxes and the select-all header checkbox.
perPageOptionsreadonly number[] | Record<number, string>[]Page sizes offered in the toolbar. A plain list (`[10, 25, 50]`) labels each option with its own number; a map (`{ 10: '10 per page' }`) uses your labels. Empty renders no select.
toggleableColumnsbooleanfalseWhether to offer the column-visibility menu in the toolbar.
searchLabelstringAccessible label override for the search input.
selectAllLabelstringAccessible label override for the select-all checkbox.
selectRowLabelstringAccessible label override for each row's select checkbox.
columnsLabelstringLabel override for the column-visibility menu's trigger.
perPageLabelstringAccessible label override for the page-size select.

Two-way models

Bind with [(name)], or one-way as an input.

PropTypeDefaultDescription
pageSizenumber5Number of rows displayed per page. Two-way bindable with `[(pageSize)]`.
visibleColumnsreadonly string[] | nullnullWhich columns are on screen, by key. `null` means "not controlled, show everything"; an empty array means every hideable column is hidden, which is a state the menu can reach. Columns marked `hideable: false` are always shown whatever this holds. Two-way bindable, so the state is yours to keep.

Types

DataRow

Record<string, unknown>

DataTableColumn

FieldTypeDescription
keystringRow property key whose value is rendered and used for sorting/searching.
labelstringColumn header text shown in the table head.
sortable?false | trueWhether the header is a sort toggle; `false` disables sorting for this column.
align?"center" | "left" | "right"Horizontal text alignment for the column's header and cells.
hideable?false | trueWhether the column may be hidden from the `toggleableColumns` menu. `false` keeps it out of the menu and always on screen — for the one column a row is unreadable without.

Every ng-blatui component also accepts a class input to merge extra Tailwind classes onto the host.