gridcn1.2.2
ExamplesFoundations

Built-in cell types

Each built-in type in one grid, plus read-only, a validate rule, and a renderCell override.

One column per built-in cell type, plus the three most common column-level overrides: readOnly, a sync validate rule, and a renderCell display override that keeps the type's full edit/sort/clipboard pipeline.

Try each column's editor: Read-only refuses edits, Validated rejects an age under 18, Currency edits the raw number behind its locale format, Link opens with alt+Enter (its javascript: row stays plain text), Notes opens a multi-line editor, and renderCell shows a progress bar.

Text
Read-only
Validated
Checkbox
Select
Date
Currency
Link
Notes
renderCell
Silent Tiger
user0@example.com
63
Viewer
Jul 5, 2023
$12.50
javascript:alert(1)
First line Second line Third line
4
Quick Lion
user1@example.com
67
Viewer
Apr 3, 2021
$15.67
Short note
89
Swift Wolf
user2@example.com
40
Manager
Oct 27, 2020
$18.84
Short note
80
Eager Lion
user3@example.com
50
User
Oct 8, 2022
$22.01
Short note
51
Eager Tiger
user4@example.com
45
Viewer
Oct 7, 2024
$25.18
javascript:alert(1)
Short note
83
Silent Wolf
user5@example.com
24
User
Jun 1, 2020
$28.35
First line Second line Third line
15
Swift Lion
user6@example.com
34
Viewer
Oct 18, 2022
$31.52
Short note
62
Eager Lion
user7@example.com
21
Manager
Oct 7, 2021
$34.69
Short note
42
pnpm dlx shadcn@latest add @gridcn/data-grid-cell-types-demo

What's in the demo

  • text: plain strings, the default type
  • text + readOnly: true: displays, refuses edits
  • number + options: { min, max }: clamped input
  • number + validate: rejects values under 18, keeps the editor open with the message
  • checkbox, select (choices), date (displayFormat)
  • number + renderCell: renders a progress bar. Editing, pasting, and sorting still run the number type's pipeline

On this page