Examples menu

๐Ÿ“Š Spreadsheet

Collaborative spreadsheet with SQLite persistence, virtual scrolling, and multi-user cursors.

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 copies the selected range as tab-separated values to 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-scoped (private per tab). Cell data and cursor positions use a custom example:spreadsheet scope, so every connected user sees live updates without leaking private state.
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โ€“4ร— throughput increase under concurrent load.
A1
' OR 1=1-- STRIX-SHEET
๐Ÿ‘ฅ 9 connected
Row 1, Col A ยท Viewing from A1
 ABCDEFGHIJ
1' OR 1=1-- STRIX-SHEEThmmaaaooohga boohga
2hhellaoeusdaasdasdasdas8
3footesting:)jj==1=h46
4hmmmmmmm okok74546wwAB2000=H3๐Ÿ”ด
5barHi52=I1fk
6 mrwhat 2df๐Ÿ”ฅ
7Nantesccc๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿ”ฅ
8testwhat๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€
946GYATTad๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€Eeerr
10eeddsasd๐Ÿš€Brotlirockingthestream๐Ÿš€Eeerr
11รนlkmezezrgghghgcompressing11 MBofdata๐Ÿš€44
12Testzreztoonly10 KB!๐Ÿš€cool
13dzrez๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€We were here
14zzre๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€
15zzzee๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€
16wee๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€
17asdasdeDervalzDeddwe're so back
18๐Ÿ”†eetYo
19eddahi guys!hello matehi m8 :o)
20eTestz

โšก Signals

viewRow / viewCol int TAB 0

Top-left corner of the visible viewport. Private per tab.

focusRow / focusCol int TAB 0

Currently focused cell coordinates.

editing bool TAB false

Whether the focused cell is in edit mode.

editValue string TAB \"\"

Current cell editor input value.

Navigation params mixed TAB

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

vrows / vcols int TAB 20ร—10

Dynamic viewport dimensions written by a client-side ResizeObserver.

version int Custom

Shared scope version counter. Bumped on every cursor/edit change to trigger broadcasts.

๐ŸŽฏ 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 โ€” 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โ€“4ร— throughput improvement over Twig rendering on the hot path.