Giter Site home page Giter Site logo

floem's Introduction

Floem

A native Rust UI library with fine-grained reactivity

It's still early days so expect lots of things missing!

fn app_view() -> impl View {
    // create a counter reactive signal with initial value 0
    let (counter, set_counter) = create_signal(0);

    // create user interface with Floem view functions
    stack((
        label(move || format!("Value: {}", counter.get())),
        stack((
            text("Increment")
                .on_click(move |_| {
                    set_counter.update(|value| *value += 1);
                    true
                }),
            text("Decrement")
                .on_click(move |_| {
                    set_counter.update(|value| *value -= 1);
                    true
                }),
        )),
    ))
}

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

Features

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

  • Cross-platform support: Supports Windows, macOS and Linux with rendering using Wgpu. In case a GPU is unavailable, a CPU renderer powered by tiny-skia will be used.
  • Fine-grained reactivity: The entire library is built around reactive primitives inspired by leptos_reactive. The reactive "signals" give the user a nice way to do reactive state management while maintaining very high performance.
  • Performance: The view tree is only run once, so the user can't accidentally put something expensive in the view generation function which slows down the whole application. The library also provides tools to help users write performant UI code. Check out the high performance virtual list example
  • Flexbox layout: Using taffy, the library provides the Flexbox (or Grid) layout system, which can be applied to any View node.

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.

floem's People

Contributors

0hypercube avatar cupnfish avatar djmcnab avatar domesticmouse avatar dzhou121 avatar imbev avatar jaredmoulton avatar jrmoulton avatar keshi avatar matthewgapp avatar maun avatar minusgix avatar panekj avatar presiyan-ivanov avatar tk103331 avatar victorcrimea avatar waywardmonkeys avatar wcubed avatar zoxc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.