Topcoat: Full-Stack Web Framework for Rust
What Topcoat is
Topcoat describes itself as "the full full-stack framework for Rust": a modular, batteries-included framework for building complete web applications, from HTML templates and routing to sessions, assets, mail and client-side interactivity. It lives under the tokio-rs GitHub organization, alongside the Tokio async runtime, and it integrates with Toasty, the organization's ORM, which appears on the roadmap.
The pitch is simplicity and productivity. Rust has solid HTTP libraries and several frontend options, but building a typical server-rendered app usually means assembling a router, a template engine, an asset pipeline, a CSS toolchain and some JavaScript for interactivity. Topcoat bundles those pieces with consistent conventions, closer in spirit to Rails, Laravel or Next.js than to a minimal HTTP toolkit.
The README is direct about maturity: "Early-stage and experimental. Expect breaking changes." It is aimed at Rust developers who want to build full-stack apps in one language and are comfortable tracking a moving API.
How it works
Topcoat renders all markup on the server. Pages and components are async Rust functions marked with #[page] and #[component], and because they are async they can query a database directly. That removes the separate JSON API layer a single-page app would normally need.
Templates are written with the view! macro, which mixes HTML with Rust expressions and ordinary Rust control flow such as for loops and if blocks inside element attributes. Components are called from markup with named arguments, as in hello(name: "World").
Client interactivity is the most distinctive part. A $(...) expression is type-checked Rust that Topcoat evaluates on the server for the initial render and also translates into JavaScript, so it re-runs instantly in the browser. Combined with signals, @click-style event handlers and :-prefixed bind attributes, this covers toggles and other local UI state without a WebAssembly bundle or a client build step. The README's example:
#[component]
async fn faq(cx: &Cx) -> Result<impl View> {
let open = signal(cx, || false);
Ok(view! {
// Runs entirely in the browser; no server round-trip.
<button @click=$(|_e| open.set(!open.get()))>"What is Topcoat?"</button>
<p :hidden=$(!open.get())>"A full-stack Rust framework."</p>
})
}When an update does need the server, such as search results, a component is marked #[shard]. Topcoat re-renders it on the server whenever one of its $(...) arguments changes and swaps the new HTML into place. Procedures provide async server functions callable from the browser, and live! and emit! replace parts of a page as async work produces new HTML.
Routing can be declared manually or inferred from the module tree without a build step: src/app.rs maps to /, src/app/about.rs to /about, underscore-prefixed modules act as layouts without a URL segment, and an api/ module holds API routes.
Key features
- Async server components: components can await database queries and other I/O while rendering.
- Dual Rust/JavaScript expressions:
$(...)expressions run on the server and in the browser from one type-checked source. - Shards: server-rendered components that refresh automatically when their reactive arguments change.
- Module-based routing: route tree derived from your module structure, with layouts and path parameters.
- Topcoat UI: a Tailwind-based component library inspired by shadcn/ui, copied into your project with
topcoat uiso you own and can edit the code. - Asset bundling: the bundler scans the compiled binary for
asset!calls, collects or downloads the files, and serves them with content-hashed URLs and aggressive caching. - Fonts and icons: utilities for web fonts and icons, with Fontsource and Iconify integrations.
- Tailwind without Node: a
tailwindfeature wires Tailwind CSS into the asset pipeline. - Request context: a
Cxvalue for pages and components, app-wide context keyed by type, and#[memoize]for per-request caching. - Cookies and sessions: signed, encrypted and prefixed cookies, plus bring-your-own-storage session authentication with sliding expiration and token rotation.
- Mail: a
mail!macro with SMTP, file and in-memory transports. - Hypermedia integrations: helpers for htmx, Alpine AJAX and Datastar.
- Formatter:
topcoat fmtformatsview!and other macro bodies.
Getting started
The getting started guide begins with a plain Cargo binary project:
cargo new hello-world
cd hello-worldAdd Topcoat and Tokio:
cargo add topcoat
cargo add tokio --features rt-multi-thread,macrosA minimal app from the README:
use topcoat::{
Result,
router::{module_router, page},
view::{View, component, view},
};
#[tokio::main]
async fn main() {
topcoat::start(module_router!().build()).await.unwrap();
}
#[page]
async fn home() -> Result<impl View> {
Ok(view! {
<!DOCTYPE html>
<html>
<body>
hello(name: "World")
</body>
</html>
})
}
#[component]
async fn hello(name: &str) -> Result<impl View> {
Ok(view! { <h1>"Hello, " (name) "!"</h1> })
}cargo run serves the app at http://127.0.0.1:3000. For automatic rebuilds, install the CLI and start the dev server:
cargo install topcoat-clitopcoat devThe dev server rebuilds on source changes, and pages that include topcoat::dev::script() reload when the new build is ready. The repository also ships an llms.txt describing its APIs and conventions for coding agents.
Use cases
- Server-rendered CRUD apps and dashboards: async components that query the database directly suit admin panels and internal tools.
- Rust-only teams: teams that want to avoid maintaining a separate TypeScript frontend can keep templates, logic and light interactivity in Rust.
- Content-heavy sites with some interactivity: menus, accordions and filters handled by
$(...)expressions, with live search via shards. - Hypermedia-style apps: projects already using htmx, Alpine AJAX or Datastar can use the provided helpers for partial HTML swaps.
- Prototyping full-stack Rust ideas: the bundled pieces (sessions, mail, UI components, Tailwind) reduce setup for side projects.
How it compares
The README does not compare Topcoat to other frameworks by name. In the Rust ecosystem, it sits between HTTP-focused libraries such as Axum or Actix Web, which leave templating and assets to you, and WebAssembly-based full-stack frameworks such as Leptos or Dioxus, which run Rust in the browser. Topcoat's approach is different from the wasm route: client logic is limited to the expression language that compiles to JavaScript, with heavier updates handled by server re-rendering. That keeps the client small but means arbitrary Rust code does not run in the browser. Its design echoes server-first frameworks in other languages, and its UI library explicitly borrows the copy-into-your-project model of shadcn/ui.
Things to know before adopting
- Experimental status: the README warns of breaking changes, and the repository was created in April 2026.
- Roadmap gaps: items still listed as planned include a
topcoat newscaffolding command, static export and pre-rendering, validations, localization, OpenAPI endpoints, deployment docs, image optimization, Markdown support, rate-limiting and compression middleware, authentication, background jobs, islands and WebTransport. - Limited client expressions:
$(...)uses a defined expression vocabulary that maps to JavaScript, so check its documented scope before planning complex client behavior. - Functions over middleware: the docs recommend modelling auth and other request-scoped concerns as functions rather than middleware, which differs from most Rust web stacks.
- Build times: the getting started guide points to the Cargo book's build performance chapter, a reminder that Rust compile times affect the edit-reload loop.
- License: MIT, which places few restrictions on commercial use.
Project activity
As of October 2026 the repository has roughly 5,800 stars on GitHub. It was created on April 3, 2026, is written in Rust, and is licensed under MIT. The crate is published on crates.io with API docs on docs.rs, CI runs on GitHub Actions, and discussion happens on the Tokio Discord. The project has no separate homepage; the source and guides are at github.com/tokio-rs/topcoat and the API reference is at docs.rs/topcoat.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/tokio-rs/topcoat
GitHub - tokio-rs/topcoat: Topcoat: Full-Stack Web Framework for Rust
Topcoat is an early-stage, MIT-licensed full-stack web framework for Rust from the Tokio project, with server-rendered async components, Rust expressions compil...
github - tokio-rs/topcoat
Related Projects
Hyperswitch: Open-Source Payments Orchestration in Rust
Juspay's modular, Rust-based payments switch with multi-PSP routing, retries, vault and reconciliation.
RustFS: Distributed S3-Compatible Object Storage in Rust
Apache-2.0, S3-compatible distributed object storage written in Rust, positioned as a MinIO alternative.
DBX: Lightweight Open-Source Database Client
A ~25 MB Rust and Tauri database client for 100+ databases, with web, CLI, MCP server and AI SQL assistant.

