Components

BaseDataTable

The data table of every list: search, filters, columns menu, grouping, selection, row and bulk actions and pagination.

components/ui/table/BaseDataTable.vue
View in the demo

Simple

Code
Product
Status
Price
PRD-001Linen shirt
Active
$59.00
PRD-002Canvas tote
Draft
$24.00
PRD-003Wool scarf
Archived
$39.00

Search, filter by status or price, hide columns, group by category, select rows to see the bulk bar and open the row menu.

Search

Code
Product
Category
Status
Price
PRD-001Linen shirtClothing
Active
$59.00
PRD-002Canvas toteBags
Draft
$24.00
PRD-003Wool scarfClothing
Archived
$39.00
PRD-004Leather walletBags
Active
$45.00
PRD-005Cotton socksClothing
Active
$12.00

Loading

Invoice
Client
Amount

Initial sort

Start a table sorted by binding v-model:sort-by to a ref: const sortBy = ref([{ key: 'issued', order: 'desc' }]). A plain :sort-by with an inline array is a controlled value without a listener, so the table goes back to it whenever the page renders again and clicking a header seems to do nothing.

vue
<BaseDataTable v-model:sort-by="sortBy" :headers :items />

On phones

Below 600px a table cannot fit its columns, so every row becomes a compact two-line row. A table with mobile-layout (an object) or #mobile-row also switches to these rows at any width when its columns still do not fit after responsive-columns hid theirs: it measures the table once fonts are loaded and goes back to columns when the container is wide enough again, so tune responsive-columns to keep the full table on laptops and let the compact rows take over below. Compact rows keep the row actions menu at the end and hide the checkboxes: under show-select a Select button in the toolbar (an icon next to the search below 600px) or a long press on a row enters selection mode, where checkboxes labelled with row-label appear, tapping a row toggles it instead of opening it, and Cancel or clearing the last row leaves the mode. Pass mobile-layout to build it from the cells you already render: primary is the column that leads the row (usually the identity cell with avatar or icon, name and subtitle), value and status stack on the end side, and details adds a line of further cells separated by dots. Each one reuses its #item.<key> slot, or shows the plain value when the column has none. For anything else, write a #mobile-row slot with BaseDataTableMobileRow. mobile-layout="stack" keeps Vuetify's label and value pairs, for documents and reference tables; without any of the three, development logs a warning naming the table's columns.

The Data tables guide covers filters, actions, card grids through #body and the density preference.

API

It also accepts every prop, slot and event of v-data-table, which it passes through.

Props

Name
Type
Default
Description
items
required
T[]—The rows.
headers
required
TableHeader[]—Vuetify headers: title, key, align, sortable, nowrap, width…
item-valuestring"id"The unique key of each row.
sort-iconstring"chevrons-up-down"Icon of a sortable column.
sort-asc-iconstring"chevron-up"Icon of an ascending sort.
sort-desc-iconstring"chevron-down"Icon of a descending sort.
searchablebooleanfalseShows the search field; / focuses it.
show-columns-menubooleanfalseLets the user hide, show and reorder columns.
show-filtersbooleanfalseShows the filters menu.
show-groupingbooleanfalseShows the group menu.
hide-footerbooleanfalseHides the pagination.
disable-paginationbooleanfalseShows every row.
items-per-page-optionsnumber[]DEFAULT_ITEMS_PER_PAGE_OPTIONSPage sizes offered.
all-rows-optionbooleanfalseAdds an “All” page size.
row-actionsTableRowAction<T>[][]Actions of the row menu: { icon, label, color?, disabled?, onClick }.
bulk-actionsTableBulkAction[][]Actions of the selection bar: { icon, label, color?, onClick }.
locked-columnsstring[][]Columns that cannot be hidden.
excluded-columnsstring[][]Columns left out of the columns menu.
responsive-columnsRecord<string, number>{}{ key: minWidth }: hides a column while the table is narrower than that width.
groupable-columnsstring[]—Columns offered in the group menu.
filtersTableFilter[][]Filter definitions: text, select, radio, boolean, range or dateRange.
loadingbooleanfalseShows skeleton rows.
loading-rowsnumber5How many skeleton rows.
row-label((item: T) => string)—Accessible name of each clickable row, such as the record id and name; screen readers announce it when the row gets focus.
mobile-layoutTableMobileLayout | "stack"—Phone row built from existing cells: { primary, value?, status?, details? } with column keys, or stack to keep label and value pairs.
v-modelunknown[][]The selected row values.
searchstring""The search text. Use v-model:search.
filter-valuesTableFilterValues{}The filter values. Use v-model:filter-values.
sort-byTableSortItem[][]The sort, such as [{ key: 'issued', order: 'desc' }]. Bind it with v-model:sort-by to a ref: a plain :sort-by resets on every render.
group-byTableSortItem[][]The grouping. Use v-model:group-by.

Slots

Name
Slot props
Description
#group-headerGroupHeaderSlotA custom group row.
#no-dataanyReplaces the default empty state. By default an empty table shows a small BaseEmptyState; with a search or filters active it says nothing matches and offers Clear search and Reset filters.
#bodyVDataTableSlotProps<any>Replaces the rows, for card grids.
#header-actionsanyControls in the toolbar, such as views.
#row-actions{ item: T; }Replaces the row menu; receives item.
#bulk-actions{ selected: unknown[]; clear: () => void; }Replaces the bulk actions; receives selected and clear.
#mobile-row{ item: T; }Replaces each row on phones (when the table stacks) with your own compact layout, usually a BaseDataTableMobileRow; receives item. It wins over mobile-layout.

Events

Name
Payload
Description
@update:modelValue[value: unknown[]]—
@update:search[value: string]—
@update:filterValues[value: TableFilterValues]—
@update:sortBy[value: TableSortItem[]]—
@update:groupBy[value: TableSortItem[]]—

Every item.<key> slot of Vuetify works to render a cell, as in the examples.

With @click:row, the rows are one tab stop: only the current row is focusable, and j/k or the arrows move between rows. Pressing j anywhere on the page focuses the current row of the first clickable table (the first row until you move), k its last row; neither fires inside a dialog, a menu or a drawer. Enter or Space opens the row and x selects it when the table has show-select.

© 2026 melsami UI.
Developer documentation for melsami UI.