Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A simple Todo list using signals.
# leptos/demo/todo.rs
use leptos::*;
#[component]
fn App() -> impl IntoView {
let todos = create_signal(Vec::<String>::new());
let input = create_signal(String::new());
view! {
div {
input(bind:value=input)
button(on:click=move |_| { todos.update(|t| t.push(input.get())); input.set(String::new()); }) {"Add"}
ul { for todos.get().iter().map(|todo| view!{ li { (todo) } }) }
}
}
}
fn main() {
mount_to_body(App);
}Leptos is a modern Rust framework for building full-stack web applications with reactive, fine-grained reactivity, enabling developers to write front-end and back-end code in Rust that compiles to WebAssembly for the browser.
Origin & Creator
Leptos is developed by Dave Yoon and the Leptos open-source community, focusing on Rust-first full-stack web development and WebAssembly applications.
Industrial Note
Leptos is ideal for developers who want to write highly performant, type-safe web apps entirely in Rust, with seamless integration between front-end WebAssembly and back-end Rust servers.