AdaptTable for Naive UI

Mobile cards in Naive UI

Below the mobile breakpoint every row becomes a card — same columns, same row content, same query state. Use Automatic, Phone cards or Scrollable table to compare the same data without remounting.

Per column, mobileLabel and hideOnMobile tune what a card shows, and on a phone the pager gives way to infinite scroll: the next rows load as the list reaches its end. There is no second layout to build.

The code

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

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

const columns: ColumnDef<Person>[] = [
  { key: "name", mobileLabel: "" },
  { key: "team", mobileLabel: "Team" },
  { key: "email", hideOnMobile: true },
];
const rowKey = (row: Person) => row.id;
</script>

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

Install

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

The same feature in the other kits

More Naive UI features

Reference: mobile. More of this kit: AdaptTable for Naive UI, or the live demo.