gridcn2.0.0
Try and automate

Playground example

Try one grid with the toolbar, context menu, fill handle, and undo, and switch row markers, validation, read-only, RTL, streaming, and the data mode live.

This grid combines the main add-ons. The controls switch single features on and off.

Name
Email
Age
Role
Score
Silent Tiger
user0@example.com
63
Viewer
4
Quick Lion
user1@example.com
67
Viewer
89
Swift Wolf
user2@example.com
40
Manager
80
Eager Lion
user3@example.com
50
User
51
Eager Tiger
user4@example.com
45
Viewer
83
Silent Wolf
user5@example.com
24
User
15
Swift Lion
user6@example.com
34
Viewer
62
Eager Lion
user7@example.com
21
Manager
42
Eager Eagle
user8@example.com
25
Editor
35
Bold Tiger
user9@example.com
19
Editor
52
Bold Bear
user10@example.com
42
User
28
Swift Wolf
user11@example.com
47
Manager
9
Swift Bear
user12@example.com
41
Viewer
45
Eager Wolf
user13@example.com
35
Editor
44
Swift Eagle
user14@example.com
65
Viewer
51
Quick Lion
user15@example.com
22
Manager
28
Bold Wolf
user16@example.com
30
Editor
76
Swift Eagle
user17@example.com
19
Admin
26
Eager Eagle
user18@example.com
35
Manager
70
Eager Bear
user19@example.com
33
Editor
67
Silent Lion
user20@example.com
48
Manager
89
Silent Tiger
user21@example.com
62
Manager
40
Eager Tiger
user22@example.com
51
Manager
82
Silent Lion
user23@example.com
26
Admin
16
Bold Eagle
user24@example.com
26
Admin
38
Bold Lion
user25@example.com
49
Viewer
3
Quick Tiger
user26@example.com
26
Viewer
41
Bold Eagle
user27@example.com
50
Editor
10
Swift Tiger
user28@example.com
55
Editor
6
Silent Lion
user29@example.com
35
Viewer
42
pnpm dlx shadcn@latest add @gridcn/data-grid-playground-demo

What the grid mounts

Every data mode mounts the toolbar, the context menu, the header dropdown, the header filter, the fill handle, the presence plugin, and the shortcuts dialog. The Shortcuts button in the toolbar opens that dialog. The toolbar holds search, a filter menu, a sort list, a columns menu, import, and export. Undo and redo mount in the virtualized mode only.

The Mode select picks the data mode. Only one is active at a time, and a switch remounts the grid:

  • virtualized holds 60 local rows.
  • paginated pages 120 local rows, 20 per page, with client pagination.
  • lazy runs scroll mode over 5,000 rows. A fake server answers each block after 300 ms. It applies the sort and ignores filters and search.

In lazy mode the import button, pinned totals, and streaming are off, because the grid holds only the loaded blocks.

Controls

ControlWhat it changesPage
Row markersThe marker column: numbers, checkboxes, or both. The reorder values add drag handles for row reordering.Row markers
Custom markerYour own marker cells. It needs a row marker mode other than none.Row markers
Header clickWhat a click on a header does: select, sort, or nothing.Pointer selection
DensityThe row height.Density
ValidationA rule on the Age column. A value under 18 shows the message Must be 18 or older.Validation
Custom headersName and Score headers with a sort direction icon.Column headers
Read-onlyLocks the whole grid.Lock cells
LoadingThe loading display.Loading state
RTLRight-to-left layout.Labels and i18n
Pinned totalsA totals row at the bottom of the grid: the row count under Name, the average Age, and the sum of Score.Pinned rows
PresenceTwo simulated peers that move across cells.Show presence
StreamingRandom Score updates four times a second. A second switch sorts the rows as they change.Stream updates

On this page