Examples · examples/checkboxes
Million
A million checkboxes shared by everyone with the page open: a box checked in one tab shows in every other within a moment, and the page holds only the visible rows.
What it shows#
- A virtual list (packages/virtual): <Repeat> and on:viewport
- State in the server's memory (Kv), with compare-and-swap
- A channel that sends only each chunk's latest version, and counts who is online
- A grid laid out by the list's width
Screenshots#
What it's made of#
- Its browser half
- 235.1 KB
- wasm, brotli; 301.5 KB gzip
- Pages and endpoints
- 1 + 2
- route files' pages, and handlers
- Lines of Roc
- 514
- its own .roc and .rocx, blank lines left out
- Tests
- 24
- 19 expects, 5 node tests
- Weighs
- 235.1 KB of wasm, brotli (301.5 KB gzip, 772.1 KB raw)
- Made of
- 1 page · 2 endpoints · 514 lines of Roc · 19 expects · 5 node tests
- Uses
- packages/virtual
Measured on 2026-11-29 at commit 74eec5b. The wasm is the app's browser half, built with --opt=size; every page also loads start.js, the page's JavaScript, 22.8 KB brotli. All the examples says how they're measured.
Run it#
With the toolchain set up (just setup), start it from its own directory: it builds, serves at http://127.0.0.1:8080 and builds again when you save. Its README says what to look at.
cd examples/checkboxes && ../../bin/rocx devTo build it, check it and run its tests, from the repository's root:
just examples checkboxes
just examples-release checkboxes # as deployed: rocx build, then the tests against a server built --opt=speed