Burin
A Rust GUI framework where Signal is the only state.
No virtual DOM. No diff. No dependency graph. No reconciliation. Just Signal<T> →
dirty flag → incremental layout → subtree cache → paint.
use *;
use Signal;
How it works
Burin builds on Auralis, a standalone
reactive kernel. Signal<T> auto-subscribes on read and auto-notifies on write.
From there, a single-direction pipeline connects each signal change to the
rendering layer (no virtual DOM, no tree diff, no reconciliation):
Signal::set()
→ register_dirty O(1) — mark the element
→ process_dirty_set O(k) — walk up ancestors, stop at containment boundary
→ Taffy incremental layout 4 paths — MEASURE / REPOSITION / full bypass
→ SubtreeCache check O(1) — unchanged siblings replay from cache
→ paint_element_tree only dirty subtrees re-record
→ GPU (wgpu) or CPU (tiny-skia) same Painter API for both
Different languages lead to different architectures. Flutter showed that retained-mode incremental rendering works at scale. Burin provides the same architectural guarantees (fine-grained dirty marking, incremental layout, subtree caching) in a fraction of the code.
Widgets
60 built-in widgets in pure Rust, with no DSL.
| Category | Widgets |
|---|---|
| Layout | VStack, HStack, ZStack, Center, Expanded, Flexible, SizedBox, Spacer, SafeArea, Padding, Conditional, GridRow, StickyHeader, SplitPane, ScrollView |
| Display | Text, Image, SvgImage, Badge, Chip, Avatar, Icon, Progress, Skeleton, BarChart, LineChart, List, Table, Tree, PropertyGrid, Calendar, EmptyState |
| Input | Button, IconButton, TextInput, NumberInput, PasswordInput, Checkbox, Switch, Slider, RadioButton, ComboBox, Select, DatePicker, ColorPicker, TextEditor, Form |
| Overlay | Modal, Dialog, Popover, Tooltip, Toast, ContextMenu |
| Composite | TabBar, TabPanel, Accordion, AudioPlayer |
Dual backend
| GPU | CPU | |
|---|---|---|
| Stack | wgpu (Vulkan / Metal / DX12) | tiny-skia + softbuffer |
| When | Desktop, performance-critical | No-GPU, headless, CI, SSR |
| API | Painter trait |
Same Painter trait |
Widgets don't need to know which backend is running. The same code works on any backend.
// Desktop window
App::new().window(config, my_ui()).run();
// Headless PNG (no window, no GPU — pure CPU)
let png = burin::render::ssr::render_to_png(my_ui(), 1200, 800)?;
Gesture arena
Not a flat on_click callback list. A Flutter-style multi-recognizer arena that
arbitrates gesture conflicts:
new
.on_tap
.on_drag
.on_long_press
7 recognizers (Tap, Drag, EagerDrag, LongPress, DoubleTap, Scroll, Custom) compete in one arena. One PointerDown never fires both click and drag.
Material 3 theme
HCT color engine. Single seed color → full light/dark palette:
let theme = from_seed;
Pluggable Theme trait, with support for Fluent, Cupertino, or custom brand themes.
TestHarness: headless full-frame testing
The test harness runs the exact same drive_frame_* functions as the real
window, with no mocking and the same hit test, gesture arena, and layout.
let mut h = new;
let id = h.mount;
h.settle;
h.click_at.run_frame;
h.assert_text;
Also: snapshot regression (assert_snapshot!), O(k) assertions (assert_subtree_cache_hits),
record-replay, and per-dimension perf regression suite.
Performance
| Scenario | Cost | Why |
|---|---|---|
| Static UI (idle) | O(1) | SceneCache full hit, zero repaint |
| Single signal change | O(k) | k = depth to nearest layout boundary |
| Scrolling | O(1) | Offset transform, SubtreeCache replay |
| Animation | O(k) | Only dirty subtree re-records |
| Cold first frame | O(N) | Full layout + full paint |
Feature flags
| Feature | Default | What |
|---|---|---|
backend-wgpu |
✓ | GPU rendering (Vulkan / Metal / DX12) |
backend-tiny-skia |
✓ | CPU rasterization |
text-cosmic |
✓ | Text shaping & caching |
system-theme |
✓ | Auto light/dark |
clipboard |
✓ | Platform clipboard |
ext-image |
✓ | PNG / JPEG / GIF / WebP |
ext-svg |
✓ | SVG rendering |
ssr |
Render to PNG headless | |
devtools |
Signal inspector + element tree + perf panel | |
i18n |
Fluent internationalization | |
tray |
System tray icon | |
file-dialog |
Native file dialogs | |
ext-jiff |
Date/time (Calendar, DatePicker) | |
ext-audio |
Audio playback |
Quick start
[]
= { = "https://github.com/chh-itt/burin" }
= "0.1"
use *;
use Signal;
Burin depends on winit 0.31 (currently in beta). We track upstream closely.
If this project helps you, consider buying me a coffee or sponsoring via 爱发电.
License
MIT OR Apache-2.0