AdaptTable for Mantine

Column management in Mantine

Everything a user expects to do to a column, without writing a column-settings panel: show and hide, reorder by drag, pin to either edge, resize by drag or keyboard, and switch row density.

Pinning is logical rather than physical, so a column pinned to the start stays on the correct side in a right-to-left layout.

The arrangement is state like any other: persist it to the URL, to localStorage, or to your own server through columnLayout and onColumnLayoutChange.

The column menu is a Mantine Popover — a Popover rather than a Menu, because the panel holds drag handles and arrow keys have to reorder rather than move a highlight — and every control in it is an ActionIcon.

The code

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

export function People({ rows, columns, layout, onLayout }) {
  return (
    <DataTable
      data={rows}
      columns={columns}
      rowKey={(row) => row.id}
      enableColumnMenu
      resizableColumns
      columnLayout={layout}
      onColumnLayoutChange={onLayout}
    />
  );
}

Install

pnpm add @adapttable/mantine @adapttable/core @mantine/core @mantine/hooks

The same feature in the other kits

More Mantine features

Reference: column-management, columns. More of this kit: AdaptTable for Mantine, or the live demo.