Tables & trees
11/19/26About 2 min
Tables & trees
Table
Presentational table: you pass the rows, columns, page and sort, and handle the emitted updatePage, updatePageSize and sort (column id) events. For a table backed by a resource, use ResourceTable (see CroutonForm).
Each column renders through its component (TextCell, BooleanCell or your own), which receives the row as data.
<Table
:data="rows"
:display-columns="[{ id: 'name', label: 'Name', scope: '#/properties/name', component: TextCell }]"
:actions="[{ icon: IconEnum.Edit, tooltip: 'Edit', action: edit }]"
:page="{ page: 1, pageSize: 5, count: total }"
:sort="{ sortColumn: 'name', sortDirection: 'asc' }"
@update-page="loadPage"
@sort="resort"
/>Other props: loading, multiselect (emits selectionChange), density="compact", emptyText, rowClick.
Pagination
Used inside Table, also available standalone.
<PaginationComponent :total-items="137" :items-per-page="size" :current-page="page" @update-page="(p) => (page = p)" />Tree view
Clicking a node with children toggles it; clicking a leaf emits select. tag renders a small badge.
<TreeView :data="[{ id: 'be', label: 'Belgium', children: [{ id: 'gh', label: 'Ghent' }] }]" :active="active" @select="(n) => (active = n.id)" />