Data tables
Diff table
A virtualized before-and-after proposal grid with explicit change state.
Starts when it scrolls into view
NORD FROST · DARK · RADIUS 6/10 · BASE 16PX · SHADOW
- Type
DiffTable- Source
diff_table.rs- Story
diff-table- Demo height
- 288 px
- Events
- DiffTableEvent
Code
Cut from the gallery story this page runs. The states above change what the demo is given rather than how it is built, so they share this code.
fn diff_story_columns() -> Vec<DiffColumn> {
vec![
DiffColumn::new("flavor", "Flavor")
.width(px(220.))
.fixed(true)
.sortable(true),
DiffColumn::new("category", "Category")
.width(px(380.))
.sortable(true),
]
}
let mut table = DiffTable::new(id, label, window, cx);
table.set_columns(diff_story_columns(), window, cx);
table.set_rows(rows, window, cx);
table
Events and ownership
- Who owns the state
- DiffTable renders state supplied by the application; it does not own durable work.
- What it emits
- Interactive intent is reported through the typed DiffTableEvent contract and stable application IDs.
- What it means
- A virtualized before-and-after proposal grid with explicit change state.
- Overflow and motion
- Wide content retains context in a bounded surface; reduced motion preserves a useful state.
Event types
- DiffTableEvent
What the demo does and does not show
The demo above is the same Rust as the native component, compiled to WebAssembly and drawn on a WebGPU canvas — not a mock-up, a recording, or a re-implementation. What it paints is what the component paints: layout, colour from the live theme, and motion.
The live browser specimen requires WebGPU; the native component remains the authoritative runtime.
A canvas cannot stand in for the platform, so treat everything that goes through the operating system as unproven here: keyboard handling and shortcuts, screen reader semantics, text input and IME, the clipboard, file drops, and the frame rate you would get on your own GPU. Judge those in a native build. If your browser has no WebGPU, the frame says so rather than showing an empty box.