Examples

Budget workbook with SUM formula

Preview
A1
ABCD
1Hosting420
2Storage180
3Total600
4
5
Example.tsx
import { Spreadsheet } from '@reactloom/data-grid';

export default function Example() {
  return (
    <Spreadsheet
      label="Quarterly budget"
      rows={5}
      columns={4}
      defaultValue={{
        A1: 'Hosting',
        B1: '420',
        A2: 'Storage',
        B2: '180',
        A3: 'Total',
        B3: '=SUM(B1:B2)',
      }}
    />
  );
}

API reference

Spreadsheet props
PropTypeDefault
labelrequired
Accessible name for the grid.
string—
rows
Number of rows.
number10
columns
Number of columns (A–Z).
number6
value · defaultValue
Cell values keyed by coordinate (e.g. A1).
Record<string, string>—
onValueChange
Called when any cell changes.
(cells: Record<string, string>) => void—

Keyboard interaction

Keyboard interactions
KeyAction
Arrow keysMove between cells
Enter / F2Edit the active cell
EscapeCancel editing

Usage guidelines

Do

  • Use SUM, AVG, MIN, MAX, COUNT, and cell references such as =A1+B1.

Don’t

  • Do not rely on Spreadsheet for large read-only tables; use DataGrid instead.