Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Tessera UI v1.0.0 Release
I am excited to announce the release of Tessera UI v1.0.0. However, don't be misled by the version number; this is still a beta version of Tessera UI. There's still a lot of work to be done, but with the core functionalities, basic components, and design stabilizing, I believe it's the right time for a release.
Tessera UI is an immediate-mode UI framework based on Rust and wgpu. You might ask: with established frameworks like egui, iced, and gpui, why reinvent the wheel? The answer is subjective, but in my view, it's because I believe Tessera UI's design represents the right direction for the future of general-purpose UI. Let me explain.
In Tessera, shaders are first-class citizens. The core of Tessera has no built-in drawing primitives like "brushes." Instead, it provides an easy-to-use WGPU render/compute pipeline plugin system, offering an experience closer to some game engines. This is intentional:
tessera_basic_components
provides a set of common components, you are free to mix and match or create your own component libraries. If you're interested, I recommend reading the documentation here, which explains how to write and use your own rendering pipelines.Using the #[tessera]
macro, you can define and compose components with simple functions, resulting in clean and intuitive code (which is why I'm a big fan of Jetpack Compose).
/// Main counter application component
#[tessera]
fn counter_app(app_state: Arc<AppState>) {
{
let button_state_clone = app_state.button_state.clone(); // Renamed for clarity
let click_count = app_state.click_count.load(atomic::Ordering::Relaxed);
let app_state_clone = app_state.clone(); // Clone app_state for the button's on_click
surface(
SurfaceArgs {
color: [1.0, 1.0, 1.0, 1.0], // White background
padding: Dp(25.0),
..Default::default()
},
None,
move || {
row_ui![
RowArgsBuilder::default()
.main_axis_alignment(MainAxisAlignment::SpaceBetween)
.cross_axis_alignment(CrossAxisAlignment::Center)
.build()
.unwrap(),
move || {
button(
ButtonArgsBuilder::default()
.on_click(Arc::new(move || {
// Increment the click count
app_state_clone // Use the cloned app_state
.click_count
.fetch_add(1, atomic::Ordering::Relaxed);
}))
.build()
.unwrap(),
button_state_clone, // Use the cloned button_state
move || text("click me!"),
)
},
move || {
text(
TextArgsBuilder::default()
.text(format!("Count: {}", click_count))
.build()
.unwrap(),
)
}
];
},
);
}
}
Result of this example
A constraint-based (Fixed
, Wrap
, Fill
) layout engine, combined with components like row
and column
(inspired by Jetpack Compose), makes it easy to implement everything from simple to complex responsive layouts. Traditional immediate-mode GUIs, by contrast, often use a simple context and preset layout methods.
Example of
row
, viewable inexample/alignment_showcase.rs
UI = f(State)
. Developers no longer need to worry about creating, updating, or destroying UI controls, nor do they have to deal with complex callback hell and state synchronization issues.easing-out
, easing-in
, easing-in-out
and then praying they match your expectations.
glass_switch
with its anim
glass_button
with its anim
Tessera UI is still in its early stages, and I do not recommend using it in a production environment. However, if you'd like to try it out, you can refer to the example crate in the repository.
screen shot of example crate
If you want to learn how to use it, please read the documentation on docs.rs, which details the APIs you'll need to know based on your level of engagement.
The release of v1.0.0 means its roadmap is either complete or has been postponed to v2.0.0. Here is the roadmap for v1.0.0:
I already have some things planned for v2.0.0 and welcome any suggestions from the community:
Tessera is an open community project, and we welcome contributions of any kind, whether it's code, documentation, or valuable suggestions. If you are interested in its design philosophy or want to build the next generation of Rust UI frameworks together, please check out our GitHub repository and Contribution Guide!
1 post - 1 participant
🏷️ rust_feed