Introduction
Swift Rust is a full-stack React framework powered with Rust + Bun that combines the developer experience of Next.js with the performance and safety of Rust. Write your app in TSX, render with a Rust core, and ship a single statically-linked binary — 10x faster than Next.js.
What you'll build
This is a complete framework, not a renderer. It includes routing, layouts, data fetching, image and font optimization, video embeds, PDF generation, error handling, metadata, code splitting, and a CLI for scaffolding and adding components.
Get started →
Install the CLI, scaffold your first project, and run the dev server in 60 seconds.
API reference
Every component, hook, and configuration option, with examples and TypeScript types.
Why a new framework?
We love Next.js's developer experience — the file-based routing, the layout system, the data fetching primitives. But we wanted to ship a single binary with no Node.js runtime, and we wanted to keep the option of full-WASM SPAs without a different framework. Swift Rust is the result.
Key features
- Native Rust HTTP Server & Radix Router: Built on Axum, Hyper, and
matchitwith 21ns route dispatch and sub-3ms cold starts. - Embedded JavaScriptCore C-FFI & WASM Navigator: In-process C-ABI JSX evaluation on the server and a compiled WebAssembly SPA router in the browser.
- SafeHtml Cryptographic Boundary: Replaces insecure
dangerouslySetInnerHTMLwith HMAC/BLAKE3 origin verification that allows signed server/codebase markup while blocking unauthenticated browser XSS injections. - Server Actions & Partial Prerendering (PPR): Full support for
"use server"mutations, progressive<Form>,"use cache",revalidateTag, and streaming PPR shells. - Four rendering modes: pure SSR, SSR with WASM hydration, SSR with HTMX, and full WASM SPAs (plus pure-Rust UI components).
- 2,071 Google fonts & bundled local fonts with automatic subsetting and
size-adjustfallbacks. - Image, Video, Script & PDF components: Built-in AVIF/WebP
<Image>, HTML5/YouTube/Vimeo<Video>, priority<Script>strategies, and declarative<Document>PDF generation. - 50+ shadcn-style UI components added with one CLI command:
bunx @swift-rust/ui add button card input. - Single binary & Vercel BOA v3 deploy:
swift-rust buildemits both a standalone binary and zero-config.vercel/outputin milliseconds.
Next steps
Continue to Installation to scaffold your first project.