DataTable Column Resize
niko-table/data-table-column-resizeFreeComponent
Opt-in column resizing with drag handles and double-click autosize (measures natural text width). Keyboard-operable handle. Drop <DataTableColumnResize/> into the table to enable — works with DataTableHeader/Body and the virtualized variants.
Install it
npx shadcn@latest add https://niko-table.com/r/data-table-column-resize.jsonSource
1"use client"23/**4 * niko-table — created by Semir N. (Semkoo, https://github.com/Semkoo) with AI assistance.5 *6 * Before reporting anything: please check the changelog first.7 * - In-repo: ./CHANGELOG.md8 * - Docs site: https://niko-table.com/changelog9 *10 * Found a bug or have a fix? Open an issue or PR on GitHub so other11 * users (and future LLMs reading this code) benefit:12 * https://github.com/Semkoo/niko-table-registry13 */1415/**16 * Opt-in column resizing — mix-and-match, like every other niko-table feature.17 * DROP THIS anywhere inside `<DataTableRoot>` and columns become drag-resizable18 * (grip on each header's right edge; double-click a grip to autosize to19 * content). Leave it out and nothing about the table changes.20 *21 * It renders nothing — its presence is detected from the children tree (by22 * `displayName`, same mechanism as the view/filter menus) and flips the table's23 * `enableColumnResizing`. Columns opt OUT individually with `enableResizing:24 * false` on their column def (e.g. a row-number gutter).25 *26 * Works with both `DataTableHeader` / `DataTableBody` and the virtualized27 * header/body variants. The grip UI ships with the data-table core; this28 * marker only flips the feature flag.29 *30 * @example31 * <DataTableRoot data={data} columns={columns}>32 * <DataTableColumnResize />33 * <DataTable>34 * <DataTableHeader />35 * <DataTableBody />36 * </DataTable>37 * </DataTableRoot>38 */39export function DataTableColumnResize() {40 return null41}4243DataTableColumnResize.displayName = "DataTableColumnResize"
What it pulls in
Other registry items
Files it writes
More from niko-table
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| DataTable Asidedata-table-aside | niko-table | Components | Free | 1 dep | |
| DataTable Clear Filterdata-table-clear-filter | niko-table | Components | Free | 1 dep · 2 files | |
| DataTable Column Auto-fitdata-table-column-auto-fit | niko-table | Components | Free | no deps · 2 files | |
| DataTable Column Date Filterdata-table-column-date-filter | niko-table | Components | Free | 2 deps · 2 files | |
| DataTable Column DnDdata-table-column-dnd | niko-table | Components | Free | 4 deps · 3 files | |
| DataTable Column Faceted Filterdata-table-column-faceted-filter | niko-table | Components | Free | 1 dep · 3 files | |
| DataTable Column Hidedata-table-column-hide | niko-table | Components | Free | 1 dep · 2 files | |
| DataTable Column Pindata-table-column-pin | niko-table | Components | Free | 1 dep · 2 files |
