Svelte Spreadsheet

The difference between a data grid and a spreadsheet is mostly interaction: cell-range selection instead of row selection, a fill handle, column-letter headers, a formula bar and paste that understands a rectangle of TSV. SvGrid ships all of that in the free package, so a sheet is a configuration of the grid rather than a separate component.

Formulas are the one piece that needs an engine. createHyperFormulaSheet binds the grid to HyperFormula so a cell can hold =SUM(B2:D2) and every dependent cell recalculates as you type, with cycle detection included.

Install

npm i @svgrid/grid

Free and MIT-licensed in @svgrid/grid: no license key, no row cap, no watermark.

The code

<script lang="ts">
  import { SvGrid, tableFeatures } from '@svgrid/grid'

  const features = tableFeatures({})
</script>

<SvGrid
  {data}
  {columns}
  {features}
  selectionMode="cell"
  enableCellSelection={true}
  showRowNumbers={true}
  rowNumberWidth={48}
/>

What you get

Live examples

Documentation

Related articles

Frequently asked questions

Can SvGrid work as a spreadsheet?

Yes. Set selectionMode to cell, enable cell selection and row numbers and you have range selection, a fill handle and clipboard round-trips. Add createHyperFormulaSheet for real formulas.

Which formulas are supported?

Formulas come from HyperFormula, so the usual sheet functions work: SUM, AVG, IF, COUNTIF, ROUND, arithmetic and string concatenation, with A1 refs and A1:A10 ranges.

Is the spreadsheet behaviour free?

Yes. Cell ranges, the fill handle, clipboard, freeze panes, validation and merging are all MIT-licensed in @svgrid/grid. Excel export and import are the paid parts.

Can I paste from Excel?

Yes. The clipboard round-trips TSV, so copying a block from Excel and pasting it into the grid keeps the rectangle and types the values as it lands.

Build something else

Get started · Browse the gallery · Pricing