+9
Daily
+75
Weekly
+154
Monthly
21,529
stars
927
forks
101
watchers
2,742
prs
1,603
issues
96
releases
README
!Crates.io MSRV
Website | Book | Docs.rs | Playground | Discord
You can find a list of useful libraries and example projects at awesome-leptos.
Leptos
rust
use leptos::;
[component]
pub fn SimpleCounter(initial_value: i32) - impl IntoView {
// create a reactive signal with the initial value
let (value, set_value) = signal(initial_value);
// create event handlers for our buttons
// note that value and set_value are Copy, so it's super easy to move them into closures
let clear = move |_| set_value(0);
let decrement = move |_| set_value.update(|value| value -= 1);
let increment = move |_| set_value.update(|value| value += 1);
// create user interfaces with the declarative view! macro
view! {
Clear
-1
// text nodes can be quoted or unquoted
"Value: " {value} "!"
+1
}
}
// we also support a builder syntax rather than the JSX-like view macro
[component]
pub fn SimpleCounterWithBuilder(initial_value: i32) - impl IntoView {
use leptos::html::;
let (value, set_value) = signal(initial_value);
let clear = move |_| set_value(0);
let decrement = move |_| set_value.update(|value| value -= 1);
let increment = move |_| set_value.update(|value| value += 1);
// the view macro above expands to this builder syntax
div().child((
button().on(ev::click, clear).child("Clear"),
button().on(ev::click, decrement).child("-1"),
span().child(("Value: ", value, "!")),
button().on(ev::click, increment).child("+1")
))
}
// Easy to use with Trunk (trunk-rs.github.io/trunk) or with a simple wasm-bindgen setup
pub fn main() {
mount_to_body(|| view! {
})
}
About the Framework
Leptos is a full-stack, isomorphic Rust web framework leveraging fine-grained reactivity to build declarative user interfaces.
What does that mean?
- Full-stack: Leptos can be used to build apps that run in the browser (client-side rendering), on the server (server-side rendering), or by rendering HTML on the server and then adding interactivity in the browser (server-side rendering with hydration). This includes support for HTTP streaming of both data (Resources) and HTML (out-of-order or in-order streaming of components.)
- Isomorphic: Leptos provides primitives to write isomorphic server functions, i.e., functions that can be called with the “same shape” on the client or server, but only run on the server. This means you can write your server-only logic (database requests, authentication etc.) alongside the client-side components that will consume it, and call server functions as if they were running in the browser, without needing to create and maintain a separate REST or other API.
- Web: Leptos is built on the Web platform and Web standards. The router is designed to use Web fundamentals (like links and forms) and build on top of them rather than trying to replace them.
- Framework: LeptoTop issues
#3675providing leptos context from axum doesn't work17 comments · 2025-03-05#2184Support hashstyle routing16 comments · 2024-01-13#4707Status Update - May 202615 comments · 2026-05-08#3872`ActionForm` does NOT respect `on:sumbit` event9 comments · 2025-04-22#3832Leptos SSR Bug, 500 Internal Server Error browser error.9 comments · 2025-04-08#3997Returning floating point NAN from a server function causes hydration error in SSR mode8 comments · 2025-05-20#3280Blocking resources: `ResponseOptions` are lost / nested blocking resources don't block but stream.8 comments · 2024-11-23#2802Content inside of declarative shadow dom is not rendered8 comments · 2024-08-09
Discussions
#4993Reactive value disposed - but why? Need help.2 comments · 2026-11-04#4979New CSR (Client Side Rendering) example - Nginx Log Analyzer (log_lens)2 comments · 2026-10-29#4975Could island_script.js get the same requestIdleCallback timeout as hydration_script.js?1 comments · 2026-10-27#4940Combining Leptos islands with Loco, htmx and Alpine1 comments · 2026-10-15#4909Making islands work with htmx swaps: happy to contribute2 comments · 2026-10-09#4849leptos_motion: core animation primitives — tweened/spring signals and enter/leave transitions — for Leptos2 comments · 2026-08-03#4848How best practice to set multiple static class?1 comments · 2026-07-29#4837Why the gaslighting on the Async Rendering and SSR “Modes” documentation4 comments · 2026-07-16
Latest release
v0.8.23 v0.8.23 2026-10-31What's Changed feat(leptos): add defer option to HydrationScripts (closes 4869) by @GauravPawar101 in https://github.com/leptos-rs/leptos/pull/4889 Backport 4964 to 0.8 by @gbj in https://github.com/leptos-rs/leptos/pull/4987 New Contributors @GauravPawar101 made their first contribution in https://github.com/leptos-rs/leptos/pull/4889 Full Changelog: https://github.com/leptos-rs/leptos/compare/v0.8.22...v0.8.23