Announcing avalanche 0.1, a React- and Svelte-inspired GUI library
I'm pleased to announce the release of avalanche, a library for building UIs. Inspired by React, components are defined as functions with hooks, and inspired by Svelte, state and parameter updates are tracked for efficient UI updating. To see how that works, check out the book and docs.
The tracking system and component definitions/calls are somewhat novel in design, so I'd appreciate feedback on how ergonomic and understandable they feel.
Avalanche is meant to be platform-independent, but right now only supports making web apps with the avalanche-web crate.
To give a taste of avalanche and avalanche-web, here's a basic counter implemented (without imports):
#[component]
fn Counter() -> View {
let (count, set_count) = state(self, || 0);
Div!([
H2!([
Text!("Counter!"),
]),
Button!(
on_click: move |_| set_count.update(|count| *count += 1),
[
Text!("+")
),
Text!(tracked!(count))
])
}
This library is still in its early days, and it has a lot to come (passing references to other components, binding parameters, generic components, custom hooks, contexts, and more) but I'm hoping it's a good foundation for an idiomatic Rust GUI. If you'd like to contribute, contributions are definitely welcome!