Skip to content

Library

Cell props, shared styles, clipboard helpers, and other grid utilities.

The Data Grid has no grid/lib/ folder. Shared utilities live next to cells and clipboard features. This page mirrors the Niko Table Library slot for those helpers.

Shared editor contract for every typed cell.

CellEditorProps is what DataGridCell passes into the render prop: focus/edit flags, commit helpers, and the current CellState.

GridComboboxOption shapes searchable dropdown options (label / value).

Export Role
CELL_HEIGHT Default row/cell height (36)
cellTriggerClass Classnames for the display trigger (status chrome)

Use these when building a custom editor so alignment matches stock cells.

Exported from the clipboard module / hook (used by DataGridClipboard):

Helper Role
parseTsv Parse clipboard text into a 2D matrix
serializeSelection Selection → TSV for copy

From data-grid-features.tsx: edge auto-scroll while dragging fill/move:

Constant Default Role
GRID_EDGE_ZONE 36 Px near edge to start scroll
GRID_EDGE_SPEED 14 Scroll step
clampGridIndex - Clamp display indices

Shared table utilities (filter operators, formatting, etc.) remain under Niko Table:

  • Library overview
  • Install deps from data-table-grid also pull scroll/flash helpers used by the grid body