A spreadsheet for Svelte.

Cells, formulas, number formats, undo, copy and paste, files in and out. A plain TypeScript engine with a Svelte grid on top, and every cell is a record you can save and sync.

A1
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Item
Units
Price
Total
Notebooks
120
€4.50
€540.00
Pens
300
€1.20
€360.00
Envelopes
500
€0.35
€175.00
Total
920
€1,075.00
Change a number: the totals follow.
Or type a formula into any cell, like =AVERAGE(C2:C4)

This sheet is the library itself, running in the page. Nothing you type here is kept.

Start

Install it, make an editor and show it in a grid: that is already a spreadsheet, with formulas, undo, and copy and paste. The toolbar and the formula bar are yours to build, or to copy from the example.

npm install @klementine/svelte-sheet @klementine/svelte-draw
Getting started
<script lang="ts">
	import { Editor, Grid } from '@klementine/svelte-sheet';
	import '@klementine/svelte-sheet/sheet.css';

	const editor = new Editor();
</script>

<Grid {editor} label="Budget" />

How it is built

Every cell is a plain record in one store, and every change is a diff. Undo, saving and syncing are listeners on that stream. The editor holds the selection and the entry being typed, and has a method for everything a person does on a grid. It is structured like the TanStack libraries: the engine, editor included, is plain TypeScript and knows no framework, so it runs in a test or on a server just the same, and Svelte is a thin layer on top.

How it is built

Where it stands

  • Written with Claude: the code, the tests and these pages. The pages are not finished, and not all of them are reviewed yet.
  • It provides the engine and the grid. You build the toolbar and the formula bar in your own design, or adapt the demo's.
  • 33 functions are built, and a sheet holds 100,000 rows by 702 columns. No dates, no charts, no several sheets in one file.
  • Every change is announced cell by cell, ready to save or send. The library itself sends nothing anywhere: a sync is yours to write.
  • MIT licensed.
What is built

svelte-sheet, MIT licensed. Source on GitHub. Visits to these pages are counted without cookies.