Skip to content

zygomedia/hobo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c1c707a · Feb 11, 2025
Jan 30, 2025
Jan 31, 2025
Feb 11, 2025
Jan 30, 2025
Jan 30, 2025
Jul 27, 2020
Nov 14, 2019
Jul 28, 2020
Sep 27, 2024
Feb 8, 2024
Jul 20, 2020
Nov 11, 2024
Jun 8, 2022
Jul 27, 2023
Dec 14, 2021
Jul 29, 2020

Repository files navigation

hobo

Crate Info API Docs

hobo is an opinionated, batteries-included Rust frontend framework. Works on stable Rust.
STILL WIP although used in production by Zygo Media.
Check out the Book!

Notable features:

  • no virtual DOM - html elements are just components added to entities and can be accessed directly via web_sys::HtmlElement
  • no Model-View-Update (aka Elm architecture) - state management is manual, usually via Entity-Component relations
  • no HTML macros - just Rust functions
  • built-in macro-based styling, kind of like CSS-in-JS except it's just Rust
  • reactivity support via futures-signals
  • Entity-Component based approach allowing flexible state propagation and cohesion between elements without coupling or a need for global store or state

Sneak peek:

pub use hobo::{
    prelude::*,
    create as e,
    signals::signal::{Mutable, SignalExt}
};

fn counter() -> impl hobo::AsElement {
    let counter = Mutable::new(0);

    e::div()
        .class((
            css::display!(flex),
            css::flex_direction!(column),
            css::width!(400 px),
        ))
        .child(e::div()
            .text_signal(counter.signal().map(|value| {
                format!("Counter value is: {value}")
            }))
        )
        .child(e::button()
            .text("increment")
            .on_click(move |_| *counter.lock_mut() += 1)
        )
}