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.
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 builtWhere 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.