Hook that returns a TablePlugin adding draggable resize handles to column header borders. Supports pointer + keyboard (WAI-ARIA window splitter) resizing, RTL, per-column min/max widths, and proportional-column preservation (resizes the neighbor so the table stays full-width). Commits widths on release.
tsimport {useTableColumnResize} from '@astryxdesign/core/Table'
| Param | Type | Description |
|---|---|---|
columnWidths | Record<string, number> | Controlled pixel-width overrides keyed by column key. When a key is present it overrides the column's declared width. |
onColumnResizeEnd | (updates: Record<string, number>) => void | Called when a resize completes (pointerup / Enter). Receives a map of every column key whose width changed — merge it into your columnWidths state. |
minWidth | number | Global minimum column width in pixels during resize. Overrides per-column defaults when set. |
maxWidth | number (default: Infinity) | Global maximum column width in pixels during resize. |
columns | TableColumn<T>[] | Column definitions — needed to derive per-column min widths and detect proportional vs pixel columns for neighbor/last-column resize behavior. |
A Table using useTableColumnResize. Drag the right edge of any column header to resize; widths are committed on release. The last proportional column flexes to fill remaining space.