0.0.1-beta.3 · Beta · pure Rust · Apache-2.0
Desktop apps in pure Rust Every frame on time
The window and event loop, frame pacing, input methods, rendering, reactive state, layout, text and animation are the framework’s job. Your app is its state and its interface.
use aureole::prelude::*;
fn main() {
App::new(|| {
let count = signal(0);
let odd = move || count.get() % 2 == 1;
column()
.padding(40)
.gap(20)
.align(Align::Center)
.child(text(move || format!("Count: {}", count.get())).font_size(20))
.child(button("Press me").on_click(move || count.update(|n| *n += 1)))
.child(
rect()
.size(64, 64)
.radius(16)
.background(move || if odd() { Color::hex(0x2563eb) } else { Color::hex(0x94a3b8) })
.transition(Property::Background, Tween::new(ms(200)).ease_out())
.scale(move || if odd() { 1.4 } else { 1.0 })
.transition(Property::Scale, Spring::bouncy()),
)
})
.title("Hello")
.size(480, 360)
.run();
}Count: 0
Press twice in a row: the square turns back from where it is, at the speed it is going, and never jumps.
- Frames at the refresh rate of the display the window is on
- 120 Hz
- Times a second a thread wakes while nothing on screen changes
- 0
- One codebase, and the same API on both
- macOS · Windows
- Open source, and free to use in commercial apps
- Apache-2.0
Performance
Your code is busy; the motion goes on.
Only what changed is done again, and what moves keeps moving while the main thread is held up.
Moved by a script on the main thread
Moved by the compositor, as Aureole’s render thread moves things
Only what changed
Writing the same value does nothing, and what can be patched in place is not rebuilt.
Motion off the main thread
Transforms, opacity and scrolling advance on the render thread, a frame at a time.
Easy on the battery
A still screen wakes no thread, and macOS Low Power Mode brings frames down to 60 fps.
Features
What a complete desktop app needs is in the framework.
Reactive state
Fine-grained signals: when a value changes, only the place that uses it updates.
Layout and lists
Rows, columns, grids and absolute positions as chained methods; virtual lists build only the rows in view.
Text and input methods
Chinese broken by character, rich text, selection across paragraphs; the input method’s candidates follow the caret.
Animation
Enter and exit, 3D and shared elements, and keyframe timelines on a clock you can pause and scrub.
Controls and overlays
Buttons, fields, tables, calendars, menus and dialogs, complete in behaviour and restyled with style objects.
The desktop
Several windows, the menu bar, the tray, notifications, file dialogs, and drag and drop out of the app.
Accessibility
Screen readers read every window; roles are mostly inferred, with nothing to annotate.
Testing
Mount an interface with no window and no GPU, step frames and simulate input: cargo test runs it.
Platforms
macOS
SupportedDeveloped and checked on Apple Silicon.
Windows
SupportedWindows 10 and 11, checked across a high-density and a standard display side by side.
Linux
ExperimentalEverything is written; X11 and Wayland are not yet checked on a real desktop.
It is in beta
The API will still change. What may change before 1.0, and what will not, is in the stability policy. Try it, and raise what you find on GitHub.
Get started
Running in three steps.
Add the dependency and cargo run as usual. To hand it to someone, install the bundler and make a package.
# Add it to your app
$ cargo add aureole@0.0.1-beta.3
# Run it
$ cargo run
# Package it: an .app and a .dmg, a Windows installer, a .deb and an AppImage
$ cargo install aureole-bundle --version 0.0.1-beta.3
$ cargo bundle --release