Examples

Explore the apps

Each example opens on its own focused app page, runs from a prebuilt wasm artifact, and includes source files you can download, modify, and rebuild locally with Roc. They are in learning order: start at the top, or jump to the feature you need.

Section 01

Reactive basics

A store of shared state, tables and their views, derived values, keyed lists and components. Each change updates exactly what depends on it, and nothing leaves the page.

Markdown Editor A markdown document with a session draft, a leave warning, cross-tab save notices, copy as text or HTML and paste to import, feeding a preview, outline and statistics. StoreDerived valuesKeyed listsComponentsLocal storageSession storageClipboard Try: Edit a draft and reload this tab, save it and open another tab, or copy the document as markdown or HTML. Paste text into the import zone to replace it. Form Builder A field designer with settings dialogs, a live preview and a form definition you can save and reopen. The designer and preview draw views of one table. StoreTables and viewsFormsDialogsPopoversScrollingDerived valuesComponentsLocal storage Try: Add and reorder a few fields, save the definition, then reload and reopen it. Try submitting the preview with a required field empty. Kanban Board Drag cards between four columns or reorder them within a column. The board uses one table of cards, a view for each column, and counts derived once for each write. StoreTables and viewsComponentsDerived values Try: Use a card's Drag handle to drop it above or below another card. Drop it on a column heading to move it to the end of that column. Spreadsheet Lite An 8x12 formula grid with cell references, SUM ranges and cycle detection over fixed-point arithmetic. Select a rectangle to copy, paste or clear cells. An edit writes only the rows whose cells changed. StoreTables and viewsDerived valuesKeyed listsKeyboard inputClipboard Try: Select a range with Shift and the arrow keys. Copy it, paste it into another range, or clear the selected cells. Data Grid A 1200-row sortable, filterable, editable grid: the rows are a table and the grid a view that draws one page of it, while a summary aggregates the rows the filter matches. StoreTables and viewsDerived valuesForms

Section 02

Effects and the network

Requests, timers, storage and the address bar, asked for by the app and answered back into it; each example talks to a simulated service that lives beside it.

Section 03

JavaScript through ports

When an app needs a browser API the platform does not model, its own JavaScript answers typed requests and sends messages, and nothing else.

Section 04

Workers and files

Roc tasks running in Web Workers, and files that never pass through the page: the page stays responsive however long the work takes.

Worker Lab Roc tasks counting primes and drawing the Mandelbrot set in Web Workers: a picture that fills in strip by strip as each worker builds its strip's file, composed by reference into one image to save; a job grid with cancel, retry and supersession, an in-flight bound you can see, a heartbeat that never stalls, and a live pool panel. StoreTables and viewsWorkersFilesCancellationIntervalsCustom elements Try: Choose "Draw the Mandelbrot set" with 32 strips of weight 16, press Start, then mount again with 1, 2, 4 and 8 workers from the pool panel and compare the time and the frame gap; with ?workers=inline no strip can be drawn, since only a worker can build a file. CSV Converter Drop a CSV of any size and convert it to TSV or JSON lines in a worker task, a chunk at a time, without its bytes passing through the page; preview the result, save it, or download a sample into a file first. StoreWorkersFiles Log Explorer Open a log of any size, or generate one: a worker indexes it once and keeps the index and the file, not its text. A Plume timeline follows the declared color preference, a search adds its matches, and a click opens the viewer at that time. The viewer follows its scrollbar and fits its observed height, with paging and precise jumps alongside it; the monitor shows preparation against each later question. StoreWorkersPreparationsFilesLayout observationsMedia queriesCustom elements Try: Generate a sample of a few hundred thousand entries and find the incident around midday. Click the timeline peak to open those lines, scroll the viewer, then use Last and Go to line to compare a coarse scrollbar move with a precise jump. Search for checkout to see its matches a minute. Featured example Million-Row Explorer Two million orders generated inside four workers and never sent to the page: every filter asks each shard for a few kilobytes of counts, the page adds them to a live order feed arriving through a port, and four Plume charts draw the sum, with the query times the runtime measured. StoreWorkersPreparationsPortsCustom elementsCancellation Try: Drag the value sliders and watch the question time the meter shows while the drag goes on; then mount it again with one worker or inline from the pool panel's links, and watch every question generate its shards again. Open application