gridcn1.2.2

Row markers

The built-in marker modes (none, number, checkbox, both) and fully custom renderers.

The marker column is pinned left and sits outside the data index space. The built-in modes: none, number, checkbox (drives the rows selection channel + a select-all header checkbox), and both (row number, replaced by the checkbox on hover/selection). Or replace the rendering entirely with your own marker/header components.

Pick "both" and hover a row: the row number is replaced by a checkbox while hovered or selected.

Row markers
Name
Role
Score
1
Silent Tiger
Viewer
4
2
Quick Lion
Viewer
89
3
Swift Wolf
Manager
80
4
Eager Lion
User
51
5
Eager Tiger
Viewer
83
6
Silent Wolf
User
15
7
Swift Lion
Viewer
62
8
Eager Lion
Manager
42
9
Eager Eagle
Editor
35
10
Bold Tiger
Editor
52
pnpm dlx shadcn@latest add @gridcn/data-grid-row-markers-demo

What's in the demo

  • rowMarkers select: switches none / number / checkbox / both and the reorder family live
  • both mode: hover a row: the number is replaced by the checkbox while hovered or selected

Custom markers

The same grid with renderMarker / renderMarkerHeader: a lucide icon marker reflecting the row's selection state, and a select-all header button, while the marker cell's own press/drag gestures still select rows.

The marker has three states: row selected (check), only cells of the row selected (minus), or neither (circle). Pressing or dragging a marker cell selects the row; a plain cell click selects that cell and clears the row selection (Ctrl+click adds a range without clearing it).

Name
Score
Silent Tiger
4
Quick Lion
89
Swift Wolf
80
Eager Lion
51
Eager Tiger
83
Silent Wolf
15
Swift Lion
62
Eager Lion
42
Eager Eagle
35
Bold Tiger
52
pnpm dlx shadcn@latest add @gridcn/data-grid-custom-markers-demo

Behavior reference

On this page