Editable Table
shadcn-table-library/editable-tableFreeBlock
Inline cell editing with per-cell validation, optimistic updates against a simulated save, and single-step undo.
Install it
npx shadcn@latest add https://shad-table.dev/r/editable-table.jsonSource
1export type Product = {2 id: string3 name: string4 price: number5 stock: number6 category: string7}89export type FieldType = 'text' | 'number'1011export interface FieldConfig {12 id: 'name' | 'price' | 'stock'13 label: string14 type: FieldType15 validate: (raw: string) => string | null16}1718export const editableFields: FieldConfig[] = [19 {20 id: 'name',21 label: 'Name',22 type: 'text',23 validate: (raw) => (raw.trim().length > 0 ? null : 'Name is required'),24 },25 {26 id: 'price',27 label: 'Price',28 type: 'number',29 validate: (raw) => {30 const n = Number(raw)31 if (raw.trim() === '' || Number.isNaN(n)) return 'Enter a number'32 if (n < 0) return 'Must be 0 or more'33 return null34 },35 },36 {37 id: 'stock',38 label: 'Stock',39 type: 'number',40 validate: (raw) => {41 const n = Number(raw)42 if (raw.trim() === '' || Number.isNaN(n) || !Number.isInteger(n)) {43 return 'Enter a whole number'44 }45 if (n < 0) return 'Must be 0 or more'46 return null47 },48 },49]
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn-table-library
All 18 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Icons Tableanimated-icons-table | shadcn-table-library | Blocks | Free | 2 deps · 9 files | |
| Comparison Tablecomparison-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Data Tabledata-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Density & Exportdensity-export-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Grouped Tablegrouped-table | shadcn-table-library | Blocks | Free | 1 dep · 3 files | |
| Heatmap Tableheatmap-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Summary / KPI Tablekpi-table | shadcn-table-library | Blocks | Free | 1 dep · 5 files | |
| Live Status Indicatorslive-status-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files |
