Build full-stack web applications in pure Rust.
A direct Rust port of Ivy-Framework.
Add the dependency to your Cargo.toml:
[dependencies]
rusty = { git = "https://github.com/Ivy-Interactive/Rusty-Framework" }Build a reactive application:
use rusty::prelude::*;structCounterApp;implViewforCounterApp{fnbuild(&self,ctx:&mutBuildContext) -> Element{let count = use_state(ctx,0);let count_display = count.clone();let count_inc = count.clone();Layout::vertical().child(TextBlock::new(&format!("Count: {}", count_display.get()))).child(Button::new("Increment").on_click(move || count_inc.update(|v| v + 1))).into()}}#[tokio::main]asyncfnmain() -> Result<(),Box<dyn std::error::Error>>{RustyServer::new(3000, || CounterApp).serve().await}Rusty-Framework follows the same architecture as Ivy-Framework:
- Views — Stateful components implementing the
Viewtrait with abuild()method - Widgets — Serializable UI primitives (Button, Text, Layout, Card, etc.) sent as JSON to the frontend
- Hooks — React-style state management (
use_state,use_effect,use_memo,use_callback) - Server — WebSocket server (via axum) that communicates with the React frontend using JSON patches
- Reconciler — Diffs widget trees and sends minimal incremental updates
| Crate | Description |
|---|---|
rusty | Core framework — views, hooks, widgets, server, shared types |
rusty-macros | Proc macros for #[derive(Widget)], #[prop], #[event] |
rusty-ivyml | Proc macros for ivyml! / ivyml_file! declarative markup |
rusty-filter | Filter query lexer/parser/AST and evaluator |
rusty-xaml | Parses XAML markup into widget trees at runtime |
rusty-server | Standalone server binary |
rusty-docs | Docs site binary; build.rs generates src/generated/ |
rusty-desktop | Native shell via wry/tao behind the optional shell feature |
The examples live in rusty/examples/ and each one starts a server on port 3000.
Set PORT to run several at once.
# Smallest possible app — layout, text and a button
cargo run --example hello_world
# use_state driving increment / decrement / reset
cargo run --example counter
# One card per widget family
cargo run --example widget_gallery
# Every input widget wired to state, with a submit summary
cargo run --example form
# Every hook, each with a visible readout
cargo run --example hooks_showcase
# Run two at once
PORT=3010 cargo run --example counter# Build everything
cargo build --workspace
# Run all tests
cargo test --workspace
# Lint
cargo clippy --workspace --all-targets -- -D warnings
# Format
cargo fmt --allMIT