leptos
Installation
SKILL.md
Leptos — Full-Stack Rust Web Framework
Overview
Leptos renders HTML from Rust components written with the view! macro and updates the page through fine-grained signals: when a signal changes, only the DOM nodes that read it are touched. It runs in two modes:
- Client-side rendering (CSR) — the app compiles to WebAssembly and is served as static files by Trunk. Fast builds, any backend.
- Server-side rendering (SSR) with hydration — one crate compiles twice: a native server binary (feature
ssr) that renders HTML, and a WebAssembly bundle (featurehydrate) that makes it interactive.cargo-leptoscoordinates both builds, and server functions let client code call server code directly.
Leptos 0.7 rewrote the API, and 0.8 keeps it. Code from older tutorials (use leptos::*, create_signal, create_resource, .into_view() on every branch) fails or warns: the current forms are use leptos::prelude::*, signal(), Resource::new(), .into_any().
Instructions
1. Set up the toolchain
Rust comes from rustup (use your distribution's rustup package, or download rustup-init and check it against the .sha256 published next to it). Then: