Home

Awesome

<div align="center">

Floem

A native Rust UI library with fine-grained reactivity

crates.io docs.rs Discord

</div>

The project is still maturing. We will make occasional breaking changes and add missing features on our way to v1.

Quickstart

Quickstart

use floem::{
    reactive::create_signal,
    views::{label, ButtonClass, Decorators},
    IntoView,
};

fn app_view() -> impl IntoView {
    // Create a reactive signal with a counter value, defaulting to 0
    let (counter, set_counter) = create_signal(0);

    // Create a vertical layout
    (
        // The counter value updates automatically, thanks to reactivity
        label(move || format!("Value: {}", counter.get())),
        // Create a horizontal layout
        (
            "Increment".class(ButtonClass).on_click_stop(move |_| {
                set_counter.update(|value| *value += 1);
            }),
            "Decrement".class(ButtonClass).on_click_stop(move |_| {
                set_counter.update(|value| *value -= 1);
            }),
        ),
    ).style(|s| s.flex_col())
}

fn main() {
    floem::launch(app_view);
}

Features

Inspired by Xilem, Leptos and rui, Floem aims to be a high performance declarative UI library requiring minimal user effort.

To sample Floem's capabilities, check out the repo and run the widget gallery example with cargo.

Widget gallery

To help you master Floem, we provide documentation and code examples.

Contributions

Contributions welcome! If you'd like to improve how Floem works and fix things, feel free to open an issue or submit a PR. If you'd like a conversation with Floem devs, you can join in the #floem channel on this Discord.