Examples menu

Spreadsheet multiplayer

Click a cell and type, move with the arrow keys, and see the cursors of other visitors. Cells are stored in SQLite, only the visible range is rendered, and edits broadcast the custom example:spreadsheet scope.

SQLite persistence: cell values survive server restarts. The database stores only non-empty cells, making the grid effectively infinite in both directions.
Virtual scrolling: only the visible cells are rendered at a time. Arrow keys, Page Up/Down, Home, mouse wheel, and Tab navigate the viewport. The server fetches only the visible range from SQLite on every render.
Dynamic resize: drag the bottom-right handle to make the grid any size. A ResizeObserver dispatches a throttled event; the browser computes how many rows and columns fit, writes them into signals, and posts to a resize action that re-renders exactly the right number of cells.
Jump to coordinate: type a cell reference like AB2000 into the toolbar input and press Enter. The server parses column letters and row number, centers the viewport, and moves the cursor in one round-trip.
Collaborative cursors: each user gets a hue derived from their session ID. Other users' focused cells show a colored border in real time, broadcast via a custom example:spreadsheet scope.
Copy & paste: Ctrl+C asks the server for the selected range, which $ctx->dispatch() sends back as tab-separated values for the clipboard. Ctrl+V pastes TSV from the clipboard starting at the focused cell, compatible with Google Sheets and Excel.
Keyboard-first UX: a single data-on:keydown__window handler covers arrows, Tab, Enter, Escape, F2, Delete, Ctrl+C, and printable-character-to-edit, with an explicit guard so the jump input is never intercepted.
Scope design: viewport position and editing state are TAB signals (private per tab). Every tab joins a custom example:spreadsheet scope, and each edit or cursor move broadcasts it, so every connected user sees live updates without leaking private state. A tab that comes back after it was away gets its position back from $c->tabState().
Raw PHP rendering: SSE update hot path uses plain PHP string building instead of Twig. Bypassing the template engine on every broadcast yields a 3 to 4× throughput increase under concurrent load.
One worker: this demo keeps the cursors, the selections and a cache of the cells in PHP statics, which each worker holds on its own. See What stays per worker before you run it with withWorkerNum().
A1
' OR 1=1-- STRIX-SHEET
0 connected
Row 1, Col A · Viewing from A1
 ABCDEFGHIJ
1' OR 1=1-- STRIX-SHEEThmmaaaooohga boohga
2hhelltestinsdapasdjjasdasdas8
3footesting:)jj==1=h46
4hmmmmmmm okoknratulations on php-via74546wwAB3000🔴
5barHi52fk
6 mrwhat 2df🔥
7Nantesccc🚀🚀🚀🚀🚀🔥
8testwhat🚀🚀🚀🚀🚀
946GYATT🚀🚀🚀🚀🚀🚀Eeerr
10eeddsasd🚀BrotliBrotlirockingthe🚀Eeerr
11ùlkmezezrgghghgcompressingcompressing11 MBof🚀44
12Testzrezdsfstotoonly10 KB🚀cool
13dzrezsdfsdfsdfsdfsd🚀🚀🚀We were here
14zzresdfsdfsdfsdfsdf🚀hr🚀🚀
15zzzee🚀🚀🚀🚀
16wee🚀🚀🚀🚀🚀
17asdasdeDervalzDeddgrgrgrwe're so back
18🔆eetYo
19🔆eddahi guys!hello matehi m8 :o)
20eTestz

Signals

viewRow / viewCol int tab scope initial: 0

Top-left corner of the visible viewport. Private per tab and server-owned (clientWritable: false), so a POST carrying an older value cannot undo a scroll.

focusRow / focusCol int tab scope initial: 0

Currently focused cell coordinates. Server-owned, so a key pressed before the last move reached the browser still applies from the new cell.

editing bool tab scope initial: false

Whether the focused cell is in edit mode. A commit also needs the edit startEdit opened on the server, so a key pressed before the last commit or Escape arrived writes nothing.

editValue string tab scope initial: empty string

Current cell editor input value.

Navigation params mixed tab scope

tr, tc, key, shift, dr, dc, pasted: client-writable action parameters for keyboard and mouse events.

vrows / vcols int tab scope initial: 20, 10

Dynamic viewport dimensions written by a client-side ResizeObserver.

Actions

focusCell

Moves cursor to a cell. Commits pending edits, updates selection, broadcasts cursor position.

navigate

Keyboard navigation: arrows, Tab, Enter, Escape, PageUp/Down, Home. Auto-scrolls viewport.

startEdit

Enters edit mode on the focused cell. Prefills with typed character or current value.

commitEdit

Writes the edit value to SQLite and broadcasts the change.

scroll

Mouse wheel scrolling: moves viewport by delta rows/columns.

scrollTo

Absolute viewport positioning on one axis, used by scrollbar drag and track clicks.

clearCells

Deletes the selected range of cells.

paste

Pastes TSV clipboard data starting at the focused cell. Compatible with Excel/Sheets.

jumpTo

Parses a cell reference like AB2000, centers viewport, and moves cursor.

Views

spreadsheet.html.twig

Outer shell rendered on initial page load only. SSE updates are generated with raw PHP string building, yielding a 3 to 4× throughput improvement over Twig rendering on the hot path.