AdaptTable for shadcn

Mobile cards in shadcn

Below the mobile breakpoint every row becomes a shadcn card. Same columns, same row content, same query state — there is nothing to configure and no second layout to build.

paginationMode="auto" resolves to infinite scroll on phones and a pager on desktop. Per column, mobileLabel and hideOnMobile tune what a card shows.

renderCard replaces the card's body with your own layout while the shell keeps selection, row actions and expansion — so a custom card is a layout decision, not a rewrite.

Each card is a list item over bg-card and border-border, and density is real: the preset carries compact variants keyed off the density attribute the table writes on its root.

The code

import { DataTable } from "@adapttable/shadcn";

export function People({ rows, columns }) {
  return (
    <DataTable
      data={rows}
      columns={columns}
      rowKey={(row) => row.id}
      paginationMode="auto"
      mobileBreakpoint={768}
      renderCard={(row, card) => (
        <MyCard row={row} {...card} />
      )}
    />
  );
}

Install

pnpm add @adapttable/shadcn @adapttable/core

The same feature in the other kits

More shadcn features

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