AdaptTable for Chakra

Column management in Chakra

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 menu is a Chakra Popover portalled out of the table, visibility is an eye IconButton with aria-pressed, and a pinned column's button turns solid — the sortable header itself is Chakra's styled button factory rather than a Button.

The code

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

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/chakra @adapttable/core @chakra-ui/react @emotion/react

The same feature in the other kits

More Chakra features

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