Guides

Data tables

Search, filter, sort, select, group and act on rows with BaseDataTable.

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

BaseDataTable wraps Vuetify's v-data-table with the toolbar, filters, column menu, bulk bar, row actions and pagination the template uses everywhere. Every Vuetify prop and slot still works.

Always use BaseDataTable (or BaseMatrixTable for checkbox grids). Do not use v-table or v-data-table directly in pages.

The smallest table

vue
<template>
  <BaseCard>
    <BaseDataTable :headers="headers" :items="customers" />
  </BaseCard>
</template>

<script setup lang="ts">
const { t } = useI18n()
const { customers } = useCustomers()

const headers = computed(() => [
  { title: t('customers.headers.name'), key: 'name' },
  { title: t('customers.headers.spent'), key: 'spent', align: 'end' as const },
  { title: t('customers.headers.orders'), key: 'orders', align: 'center' as const },
])
</script>

A complete table

This is the customers table of the demo:

pages/e-commerce/customers/index.vue
<BaseDataTable
  v-model="selected"
  v-model:search="search"
  v-model:filter-values="filterValues"
  item-value="id"
  :items="rows"
  :headers="headers"
  :filters="filters"
  :row-actions="rowActions"
  :bulk-actions="bulkActions"
  :locked-columns="['name']"
  :responsive-columns="{ country: 1020 }"
  show-select
  searchable
  show-columns-menu
  show-filters
  hover
  @click:row="(_, { item }) => openQuickView(item.id)"
>
  <template #header-actions>
    <BaseToggleGroup v-model="view" :items="viewItems" compact fit mandatory />
  </template>

  <template #item.name="{ item }">
    <BaseUserIdentity :name="item.name" :email="item.email" />
  </template>
</BaseDataTable>

Props

Prop
Type
Default
Description
itemsT[]—The rows.
headersTableHeader[]—Vuetify headers: title, key, align, sortable, nowrap…
item-valuestringidThe unique key of each row.
searchablebooleanfalseShows the search field. Bind the text with v-model:search.
show-filtersbooleanfalseShows the filters menu built from filters.
filtersTableFilter[][]Filter definitions. Bind the values with v-model:filter-values.
show-columns-menubooleanfalseLets the user hide and show columns.
locked-columnsstring[][]Columns that cannot be hidden.
excluded-columnsstring[][]Columns left out of the columns menu.
responsive-columnsRecord<string, number>{}Hides a column while the table is narrower than the given width in pixels.
show-groupingbooleanfalseShows the group menu. Limit it with groupable-columns.
row-actionsTableRowAction<T>[][]Actions in the menu at the end of each row.
bulk-actionsTableBulkAction[][]Actions in the bar that appears when rows are selected.
items-per-page-optionsnumber[][10, 25, 50, 100]Page sizes offered in the footer.
all-rows-optionbooleanfalseAdds an “All” page size.
hide-footerbooleanfalseHides the pagination footer.
disable-paginationbooleanfalseShows every row.
loadingbooleanfalseShows loading-rows skeleton rows.

Filters

ts
const filters = computed<TableFilter[]>(() => [
  { key: 'segment', type: 'select', label: t('customers.headers.segment'), options: segmentOptions.value, multiple: true },
  { key: 'status', type: 'radio', label: t('customers.headers.status'), options: statusOptions.value },
  { key: 'marketing', type: 'boolean', label: t('customers.form.marketing') },
  { key: 'spent', type: 'range', label: t('customers.headers.spent'), step: 100, prefix: '$' },
  { key: 'lastOrder', type: 'dateRange', label: t('customers.headers.lastOrder') },
  { key: 'city', type: 'text', label: t('customers.headers.city') },
])

range filters compute their min and max from the data when you leave them out. A select with multiple also matches rows whose value is an array, for example tags.

Row and bulk actions

ts
const rowActions = computed<TableRowAction<Customer>[]>(() => [
  { icon: 'eye', label: t('actions.view'), onClick: (item) => openQuickView(item.id) },
  { icon: 'pencil', label: t('actions.edit'), onClick: openEdit, disabled: () => !can('customers.update') },
  { icon: 'trash-2', label: t('actions.delete'), color: 'error', onClick: confirmDelete },
])

const bulkActions = computed<TableBulkAction[]>(() => [
  { icon: 'trash-2', label: t('actions.delete'), color: 'error', onClick: (ids) => removeMany(ids as string[]) },
])

Slots

Besides every Vuetify slot (item.<key>, group-header, body…), BaseDataTable adds:

Slot
Props
Use
header-actions—Controls in the toolbar, such as views as a BaseToggleGroup compact fit.
row-actions{ item }Replaces the row actions menu.
bulk-actions{ selected, clear }Replaces the bulk bar actions.

To render the rows as a grid of cards (as products and courses do), use the Vuetify #body slot. Search, filters, sorting and pagination keep working. Give the table a :key that changes with the layout, because slots are read once.

Density

The user's density preference applies to every table through v-defaults-provider in the default layout, so do not set density on a page table.

© 2026 melsami UI.
Developer documentation for melsami UI.