# Blank sheet - just type

An empty Excel-style sheet on a plain <SvGrid>: column-letter headers (A..Z), a built-in 1..N row gutter, a name box + formula bar with a browsable function picker, gridlines, range selection and a fill handle. A real HyperFormula engine underneath: type a literal or a formula like =SUM(B2:D2) / =IF(...) and every dependent cell recalculates live. Drag a row or column border to resize; right-click for Cut / Copy / Paste / Clear.

Requires `@svgrid/enterprise` (and `@svgrid/grid`). Category: Spreadsheet. Live demo: https://svgrid.com/demos/207-blank-sheet/

Install: `npm i @svgrid/grid @svgrid/enterprise` (Svelte 5).

## About this example

An empty Excel-style sheet on a plain Svelte 5 SvGrid: column-letter headers, the grid's built-in row-number gutter, a name box and formula bar with a browsable function picker, gridlines, range selection and a fill handle. HyperFormula computes the display values, so typing a literal or a formula such as =SUM(B2:D2) or =IF(...) recalculates every dependent cell live; drag a row or column border to resize and right-click for Cut, Copy, Paste and Clear.

An empty workbook and nothing else:

```text
<SvSheet />
```

With no `workbook` and no `data` it creates a single empty sheet, which is what "open a spreadsheet" means. Click a cell, type a number, type =SUM(A1:A5) and watch it resolve.

Worth trying, because none of it is wired up in this file:

```text
Ctrl+Arrow      run to the edge of a block, hopping gaps
Ctrl+D / Ctrl+R fill down / right, translating references as they go
Ctrl+;          stamp today's date
Alt+=           AutoSum the run above
Ctrl+B          bold, and watch the ribbon button light up
Ctrl+Shift+4    currency
Ctrl+Z          one press per action, not one per cell
```

Drag the fill handle on the active cell's corner to extend a series; drag a column border in the header to resize.

Everything typed, formatted, resized, hidden or frozen is the sheet's document: `getState()` returns it as JSON and `setState()` puts it back, and `onChange` says when something landed. In development the pair is on `window.svSheet` so the browser tests can save and restore.

## Imports, features and API used

- Imports: `@svgrid/enterprise`

## Frequently asked questions

### What does the grid provide and what does the demo add?

The grid supplies the row-number gutter with showRowNumbers, inline editing, cell-range selection with the fill handle, rowResize and header resize. The demo adds the letter columns, the name box, the formula bar with autocomplete and the HyperFormula engine.

### How does the function picker work?

Typing = in the formula bar opens a list of functions filtered by prefix with their signature; choosing one inserts it, so a signature never has to be remembered.

### Where does the value live?

The grid stores the raw text you typed. HyperFormula evaluates it and the cell shows the result, so editing a cell always shows the formula, not the number.

## Related documentation

- [Migrating from Handsontable](https://svgrid.com/docs/help/migrating-from-handsontable.md)
- [Spreadsheet: getting started](https://svgrid.com/docs/help/sheet/start.md)
- [Spreadsheet formulas](https://svgrid.com/docs/help/spreadsheet-formulas.md)

## Related articles

- [A Fill Handle (Drag to Fill) in SvGrid](https://svgrid.com/blog/fill-handle-drag-to-fill/) - Build a working spreadsheet-style fill handle on top of SvGrid's cell selection and editing - pointer tracking, range highlighting, series fill, and undo/redo integration all covered.
- [Pivot Tables in Svelte - Summarize Data Without a Spreadsheet](https://svgrid.com/blog/pivot-tables/) - Run a cross-tab pivot directly inside your Svelte app using @svgrid/enterprise createPivotModel - no Excel, no server-side aggregation, no stale exports.
- [Spreadsheet-Style Cell Range Selection in SvGrid](https://svgrid.com/blog/cell-range-selection/) - How to enable drag-to-select cell ranges, read live selection state, and build a status-bar footer that sums and averages the selected values.

## Source code (207-blank-sheet.svelte)

```svelte
<script lang="ts">
  /**
   * 207. Blank sheet - just type
   * -----------------------------
   * An empty workbook and nothing else:
   *
   *   <SvSheet />
   *
   * With no `workbook` and no `data` it creates a single empty sheet, which
   * is what "open a spreadsheet" means. Click a cell, type a number, type
   * =SUM(A1:A5) and watch it resolve.
   *
   * Worth trying, because none of it is wired up in this file:
   *
   *   Ctrl+Arrow      run to the edge of a block, hopping gaps
   *   Ctrl+D / Ctrl+R fill down / right, translating references as they go
   *   Ctrl+;          stamp today's date
   *   Alt+=           AutoSum the run above
   *   Ctrl+B          bold, and watch the ribbon button light up
   *   Ctrl+Shift+4    currency
   *   Ctrl+Z          one press per action, not one per cell
   *
   * Drag the fill handle on the active cell's corner to extend a series;
   * drag a column border in the header to resize.
   *
   * Everything typed, formatted, resized, hidden or frozen is the sheet's
   * document: `getState()` returns it as JSON and `setState()` puts it
   * back, and `onChange` says when something landed. In development the
   * pair is on `window.svSheet` so the browser tests can save and restore.
   */
  import { SvSheet } from '@svgrid/enterprise'

  let sheet = $state<SvSheet>()
  $effect(() => {
    const mounted = sheet
    if (!import.meta.env.DEV || !mounted) return
    ;(window as unknown as { svSheet?: unknown }).svSheet = {
      getState: () => mounted.getState(),
      setState: (state: Parameters<SvSheet['setState']>[0]) => mounted.setState(state),
      changes: [] as string[],
    }
  })
</script>

<SvSheet
  bind:this={sheet}
  height="100%"
  rows={60}
  columns={14}
  onChange={(reasons) => {
    if (!import.meta.env.DEV) return
    const handle = (window as unknown as { svSheet?: { changes: string[] } }).svSheet
    handle?.changes.push(...reasons.map((r) => r.kind))
  }}
/>
```

[View this example on GitHub](https://github.com/sv-grid/sv-grid/blob/main/examples/src/demos/207-blank-sheet.svelte)
