Copy / paste
View sourceCmd+C copies the active range as TSV (tab-separated values, the format Excel and Google Sheets use). Cmd+V pastes TSV back, applying value parsers + per-column validate, with atomic rollback on failure.
Edit a cell, drag a range, Cmd+C, paste back to overwrite. Paste-driven commits show source: "paste".0 cells updated via paste
Try this
Customer / Sales rep / Amount columns are editable. Status / Region are read-only — pasting into them is silently skipped.
- Click a cell, drag to select a range, then Cmd+C.
- Paste it into Excel / Sheets / VSCode — same rectangular shape.
- Now click a different anchor cell in the grid and Cmd+V — the values overwrite from that anchor.
- Copy a single column from Excel and paste in — works the same way.
- Try pasting non-numeric text into Amount — the cell rejects, the row rolls back, the error surfaces in the cell.
Copy
- TSV by default. Cmd+C on a range emits TSV using each cell's formatted value (the same value the renderer paints). Round-trip-safe with Excel.
- HTML alongside. Where the platform allows multiple clipboard formats, bc-grid also writes an HTML table mirror so paste targets that prefer HTML (e.g. rich-text editors) get a styled table.
- Hooks.
onCopylets the consumer transform or augment the clipboard payload (e.g. add a JSON variant for round-trip-safe paste back into this app).
Paste
- TSV parsed. Paste from Excel / Sheets / any TSV — bc-grid splits rows by
\\n, cells by\\t, and walks the active cell as the anchor. - Through the column pipeline. Each pasted cell goes through
column.valueParser(string → typed value) andcolumn.validatebefore commit. A rejected cell rolls back the whole row patch. - Read-only cells skipped. Cells in non-editable columns are ignored without aborting the paste; pasted rectangle keeps its alignment.
- Source = "paste".
onCellEditCommitfires for each accepted cell withsource: "paste"so consumers can branch (audit log, telemetry, etc.). - Imperative API.
apiRef.current?.pasteTsv(tsv, { mode })for programmatic paste (e.g. drag-drop a CSV file onto the grid).