AdaptTable for shadcn-vue

Accessible shadcn-vue data table

Tab into the grid and the arrows move a visible focus, one cell at a time. Home and End jump to the row's edges.

Every move, sort, filter and edit is announced through a live region — the part of a table a sighted reader cannot check, so this page repeats those announcements as text as they happen.

columnSelectionCheckbox puts a named checkbox on each header so a column can be selected without a modifier key a touchscreen does not have. Focus, selection, status and disabled controls stay legible in high contrast and forced-colors — nothing is color-only. The grid and the checkboxes are shadcn-vue.

The code

<script setup lang="ts">
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/shadcn-vue";
import { cellNavigation } from "@adapttable/shadcn-vue/cell-navigation";
import { columnSelectionCheckbox } from "@adapttable/shadcn-vue/column-selection";

defineProps<{
  rows: readonly Person[];
  columns: readonly ColumnDef<Person>[];
}>();

const rowKey = (row: Person) => row.id;
const features = [cellNavigation(), columnSelectionCheckbox()];
</script>

<template>
  <DataTable
    table-label="People keyboard grid"
    :data="rows" :columns="columns" :row-key="rowKey"
    :features="features"
  />
</template>

Install

pnpm add @adapttable/shadcn-vue @adapttable/vue @adapttable/core reka-ui

The same feature in the other kits

More shadcn-vue features

Reference: accessibility, cell-navigation. More of this kit: AdaptTable for shadcn-vue, or the live demo.