Data display
Spreadsheet
Interactive spreadsheet grid with A1 cell coordinates, a formula bar, and safe formula evaluation.
import '@reactloom/data-grid/styles.css';
import { Spreadsheet } from '@reactloom/data-grid';Examples
Budget workbook with SUM formula
A1
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Hosting | 420 | ||
| 2 | Storage | 180 | ||
| 3 | Total | 600 | ||
| 4 | ||||
| 5 |
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
| Prop | Type | Default |
|---|---|---|
labelrequiredAccessible name for the grid. | string | — |
rowsNumber of rows. | number | 10 |
columnsNumber of columns (A–Z). | number | 6 |
value · defaultValueCell values keyed by coordinate (e.g. A1). | Record<string, string> | — |
onValueChangeCalled when any cell changes. | (cells: Record<string, string>) => void | — |
Keyboard interaction
| Key | Action |
|---|---|
| Arrow keys | Move between cells |
| Enter / F2 | Edit the active cell |
| Escape | Cancel 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.