7 releases

new 0.3.0-alpha.4 May 23, 2024
0.3.0-alpha.3 May 10, 2024
0.2.0 Feb 24, 2024
0.1.0 Feb 23, 2024

#14 in #body

Download history 206/week @ 2024-02-18 150/week @ 2024-02-25 20/week @ 2024-03-03 6/week @ 2024-03-10 17/week @ 2024-03-31 236/week @ 2024-05-05 17/week @ 2024-05-12 83/week @ 2024-05-19

336 downloads per month

MIT/Apache

14KB
364 lines

Actuate

Crates.io version docs.rs docs CI status

A high-performance reactive user-interface framework for Rust. This crate provides a generic library that lets you define UI using declarative, type-safe syntax. Views combine together to form a statically-typed view tree that can be stored on the stack, giving this architecture its high performance.

use actuate::{use_state, Scope, View};

struct App;

impl View for App {
    fn body(&self, cx: &Scope) -> impl View {
        let (count, set_count) = use_state(cx, || 0);

        dbg!(count);

        set_count.set(count + 1)
    }
}

#[tokio::main]
async fn main() {
    actuate::run(App).await
}

Inspiration

This crate is inspired by Xilem and uses a similar approach to type-safe reactivity. The main difference with this crate is the concept of scopes, components store their state in their own scope and updates to that scope re-render the component.

State management is inspired by React and Dioxus.

Dependencies

~285KB