Overview

Resize columns by dragging the edge between column headers - just like in Excel. Supports min/max constraints, per-column opt-out, and localStorage persistence.

CR01 Interactive Demo

Hover between column headers to see the resize cursor. Drag to resize. The ID column has isResizable: false.

Resize Log: Drag the edge between column headers to resize...
Column Resizing
 

CR02 LocalStorage Persistence

Save column widths to localStorage so they persist across page reloads.

Persistence Setup
 

Programmatic API

Programmatic Control
 

API Reference

Grid Properties

PropertyTypeDefaultDescription
gridNamestring-Unique name for localStorage persistence
shouldPersistColumnWidthsbooleanfalseSave column widths to localStorage
oncolumnresizefunction-Callback after resize completes

Column Properties

PropertyTypeDefaultDescription
isResizablebooleantrueWhether column can be resized
minWidthstring-Minimum width constraint (e.g., '100px')
maxWidthstring-Maximum width constraint (e.g., '300px')

Methods

MethodDescription
setColumnWidth(field, width)Set width of a single column
setColumnWidths(widths)Set widths of multiple columns (array of { field, width })
getColumnWidthsState()Get current widths of all columns

ColumnResizeDetail Interface

TypeScript Types