AdaptTable for Nuxt UI

Row grouping in Nuxt UI

Compose groupingPanel(groupBy) and rows start nested by Team then Status. Drag a column header into the strip or add a level from its select, and reorder the levels by dragging a chip or with the arrow keys on its handle; every move is announced.

Each group header folds its rows and shows its row count and the totals its columns declare as aggregatable — Budget sums here, and the panel changes the operation. The grouping travels in the URL.

The code

<script setup lang="ts">
import type { ColumnDef } from "@adapttable/vue";
import { DataTable } from "@adapttable/nuxt-ui";
import { groupingPanel } from "@adapttable/nuxt-ui/grouping-panel";

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

const columns: ColumnDef<Person>[] = [
  { key: "name" },
  { key: "team" },
  { key: "status" },
  { key: "budget", aggregatable: { operations: ["sum", "avg"] } },
];
const rowKey = (row: Person) => row.id;
const features = [groupingPanel(["team", "status"])];
</script>

<template>
  <DataTable
    :data="rows"
    :columns="columns"
    :row-key="rowKey"
    url-key="g"
    :features="features"
  />
</template>

Install

pnpm add @adapttable/nuxt-ui @adapttable/vue @adapttable/core @nuxt/ui

The same feature in the other kits

More Nuxt UI features

Reference: row-grouping, pinned-summary-rows, row-reordering. More of this kit: AdaptTable for Nuxt UI, or the live demo.