gridcn1.2.2
ExamplesFoundations

Editable hero grid

Every built-in cell type, range selection, the fill handle add-on, and native clipboard.

The hero grid: an editable table with every built-in cell type in one composition. It uses the split composition (DataGridProvider + DataGridRoot + header/body parts) to show the parts. The data-grid-fill add-on is passed through the provider's plugins prop; the plugin's own Mount member renders inside DataGridRoot, so no extra child is needed.

Name
Email
Age
Active
Role
Joined
Score
Silent Tiger
user0@example.com
63
Viewer
Jul 5, 2023
4
Quick Lion
user1@example.com
67
Viewer
Apr 3, 2021
89
Swift Wolf
user2@example.com
40
Manager
Oct 27, 2020
80
Eager Lion
user3@example.com
50
User
Oct 8, 2022
51
Eager Tiger
user4@example.com
45
Viewer
Oct 7, 2024
83
Silent Wolf
user5@example.com
24
User
Jun 1, 2020
15
Swift Lion
user6@example.com
34
Viewer
Oct 18, 2022
62
Eager Lion
user7@example.com
21
Manager
Oct 7, 2021
42
Eager Eagle
user8@example.com
25
Editor
Jun 11, 2024
35
Bold Tiger
user9@example.com
19
Editor
Mar 20, 2024
52
Bold Bear
user10@example.com
42
User
Apr 16, 2020
28
Swift Wolf
user11@example.com
47
Manager
Aug 4, 2022
9
pnpm dlx shadcn@latest add @gridcn/data-grid-demo

What's in the demo

  • text, number (with min/max options), checkbox, select (choices), date (displayFormat): all seven columns, flex-sized
  • Range selection: click-drag to select a rectangular range
  • useDataGridFill: the fill-handle plugin (overlay + drag engine)
  • Native clipboard: Ctrl/Cmd+C/V over the selection
  • defaultData via generateDemoRows(12): seed rows, zero app-side state

On this page