Sycamore
By the Sycamore open-source project
Sycamore is an open-source Rust framework for building reactive web applications, using a fine-grained signal-based reactivity model rather than a virtual DOM, and compiling client-side code to WebAssembly. It draws direct inspiration from…
Definition
Sycamore is an open-source Rust framework for building reactive web applications, using a fine-grained signal-based reactivity model rather than a virtual DOM, and compiling client-side code to WebAssembly. It draws direct inspiration from SolidJS, bringing a similar reactive programming style into the Rust ecosystem while prioritizing small compiled output size, fast runtime execution speed, and predictable, minimal-overhead rendering behavior for browser-based applications.
Overview
Sycamore was created to explore what a SolidJS-style, signals-first reactive framework would look like implemented in Rust rather than JavaScript, prioritizing runtime performance and a small compiled footprint. Instead of building an in-memory virtual representation of the interface and comparing it against a previous version on every update, Sycamore tracks the exact dependencies between reactive state and the parts of the DOM that read it, so a change to one signal updates only the DOM nodes that actually depend on it. Mechanically, developers declare reactive signals to hold state, and Sycamore's compiler-assisted reactive system automatically subscribes any expression that reads a signal to future changes in that signal's value. When state changes, only the specific, previously subscribed DOM updates run, skipping the tree-diffing step that virtual-DOM frameworks require and keeping update work proportional to the size of the change rather than the size of the tree. Sycamore compiles to WebAssembly for browser execution and provides a component macro syntax for composing reusable UI pieces, along with routing and other web-application conveniences through companion crates maintained alongside the core library. Within the Rust web ecosystem, Sycamore occupies similar territory to Leptos, both of them being signals-based alternatives to Dioxus's more React-like virtual-DOM model, though Leptos has invested more heavily in full-stack server-rendering features while Sycamore has stayed closer to its original client-side, SolidJS-inspired scope. Perseus, a meta-framework for server-side rendering and static site generation, was built on top of Sycamore specifically to add those full-stack capabilities without changing Sycamore's core reactivity model. In practice, Sycamore is used for building interactive, WebAssembly-compiled front-ends where developers want Rust's type safety and performance characteristics along with a reactive programming model that deliberately avoids virtual-DOM overhead altogether. It is often chosen by teams already comfortable with SolidJS's mental model who want to bring similar reactive patterns to a Rust codebase, or by developers building on top of the Perseus meta-framework for more complete application scaffolding and routing. The trade-offs mirror those of the broader Rust web UI space overall: a smaller ecosystem and component library selection than JavaScript frameworks, noticeably longer compile times during iterative development compared to hot-reloading JavaScript tooling, and a real learning curve for developers unfamiliar with Rust. Sycamore's narrower focus on client-side reactivity, relative to frameworks like Leptos, also means teams needing built-in server-side rendering typically reach for Perseus alongside it rather than Sycamore alone, adding an extra layer to the stack.
Key Features
- Implements fine-grained reactivity using signals inspired by SolidJS
- Avoids virtual-DOM diffing, updating only dependent DOM nodes directly
- Compiles client-side application code to WebAssembly
- Provides a macro-based component syntax for composing UI
- Supports routing and additional features through companion crates
- Serves as the reactive foundation underlying the Perseus meta-framework
- Prioritizes small compiled bundle size and runtime performance