easy-to-use immediate mode client side Rust web framework

Related tags

Command-line edom
Overview

An immediate mode web frontend library written in Rust.

Latest version Documentation MIT

It builds up VDOM for not having to run too many DOM operations, but as it runs every time any change is executed, it allows for a simple programming model without message passing / callbacks / signals, just like EGUI.

The render function is called once for creating the initial web page, and then twice for each event:

  • once for computing the side effects of the event
  • once more for rendering the changes that happened by modifying the state (variables)

A very simple program to illustrate usage

(in examples/demo directory):

use edom;
use wasm_bindgen::prelude::wasm_bindgen;

#[wasm_bindgen(start)]
pub fn demo() {
    let mut name = "Arthur".to_string();
    let mut age:f64 = 42.0;
    edom::wasm::render(move |mut root| {
        root.h1().text("My edom application");
        root.div(|div| {
            div.text("Your name: ");
            div.text_input(&mut name);
        });
        root.div(|div| {
            div.range_input(&mut age, 0.0, 120.0);
            div.number_input(&mut age).min(0.0).max(120.0);
            div.text("age");
        });
        if root.button("Click each year").clicked() {
            age+=1.0;
        }
        root.br();
        root.text(format!("Hello '{}', age {}", name, age).as_str());
    });
}

Demo

For a more complex example check TODOMVC

Benchmark

You might also like...
Example of an dark-mode toggle button based on progressive enhancement

Leptos Starter Template This is a template for use with the Leptos web framework and the cargo-leptos tool. Creating your template repo If you don't h

Windlass, a Rust Klipper host side protocol implementation

Windlass Windlass is an implementation of the host side of the Klipper protocol. The project is currently to be considered alpha quality code. Licensi

The dead easy way to use config files in your rust project

Configr The dead easy way to use config files in your project This will load a config.toml file if it exists, otherwise it will create the needed fold

An easy-to-use TUI crate for Rust, based off of the Elm architecture.

Rustea An easy-to-use TUI crate for Rust, based off of the Elm architecture. This is a re-implementation of Go's Tea, created by TJ Holowaychuk. Featu

82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead.
82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead.

Spinners for Rust 82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead, all the way from simple dots, to fun emoji based "spi

An easy to use library for pretty print tables of Rust structs and enums.
An easy to use library for pretty print tables of Rust structs and enums.

tabled An easy to use library for pretty printing tables of Rust structs and enums. Table of Contents Usage Settings Style Themes ASCII Psql Github Ma

🚀 A blazingly fast easy to use dotfile and global theme manager written in Rust
🚀 A blazingly fast easy to use dotfile and global theme manager written in Rust

GTHEME A blazingly fast easy to use dotfile and global theme manager for *NIX systems written in Rust 🔥 Demo using wip desktop. To check out more des

A blazing fast and easy to use TRPC-like server for Rust.

rspc 🚧 Work in progress 🚧 A blazing fast and easy to use TRPC-like server for Rust. Website Example You define a trpc router and attach resolvers to

An easy-to-use SocketCAN library for Python and C++, built in Rust.

JCAN An easy-to-use SocketCAN library for Python and C++, built in Rust, using cxx-rs and pyo3. Warning: I have never used Rust before and I don't kno

Owner
null
A Rust CLI tool that helps you enforce Git policies through Git hooks both server and client side

GitPolicyEnforcer This is a command line utility written in Rust, that helps you utilize Git hooks, to enforce various policies. It currently supports

Vagelis Prokopiou 4 Aug 14, 2022
Rust client-side implementation of the rock usb protocol

Utility crates to interact with Rockchip devices Rockchip SoCs implement a custom USB protocol when starting in a special recovery mode (sometimes cal

Collabora 12 Mar 14, 2023
A binary that bootstraps a Leptos application with client side rendering, tailwind, and vercel

create-leptos-csr-tw This CLI provides a quick setup to start building web applications using the Leptos web framework integrated with TailwindCSS. It

Matthew 3 Nov 3, 2023
Fermyon Spin + Dioxus - Client Side Rendering (CSR) template with TailwindCSS

spin-dioxus-csr Fermyon Spin + Dioxus - Client Side Rendering (CSR) template with Tailwind Setup Accomodate "chicken & egg" issue for https://github.c

null 4 Apr 9, 2024
Experimental integration of `fedimint-client` with the Leptos web frontend framework

CAUTION: highly experimental, the Database implementation is likely horribly broken Fedimint Client built with Leptos This repo contains a proof-of-co

null 3 Aug 27, 2023
An Intel HAXM powered, protected mode, 32 bit, hypervisor addition calculator, written in Rust.

HyperCalc An Intel HAXM powered, protected mode, 32 bit, hypervisor addition calculator, written in Rust. Purpose None ?? . Mostly just to learn Rust

Michael B. 2 Mar 29, 2022
A lightweight but incredibly powerful and feature-rich BitTorrent tracker. Supports UDP + HTTP(S) and a private tracker mode.

Torrust Tracker Project Description Torrust Tracker is a lightweight but incredibly powerful and feature-rich BitTorrent tracker made using Rust. Feat

Torrust 162 Dec 31, 2022
A simple cli tool to help with wordle in hard mode

Wordking A simple cli tool to help with wordle in hard mode. Usage Run wordking cargo run Wordking will ask for your guesses thus far. Provide your gu

Stephen Spalding 2 Feb 1, 2022
A super simple prompt for Fish shell, just shows git info and Vi mode.

vifi is a portmandeau of 'Vi' and 'Fish', because it's a prompt for Fish shell, primarily focused around showing proper indicators when using Vi key bindings.

Mat Jones 1 Sep 15, 2022
Tricking shells into interactive mode when local PTY's are not available

Remote Pseudoterminals Remote Pseudoterminals or "RPTY" is a Rust library which intercepts calls to the Linux kernel's TTY/PTY-related libc functions

null 135 Dec 4, 2022