Back

Meet Rspress: A Rust-Powered Site Generator

Meet Rspress: A Rust-Powered Site Generator

If you maintain a React component library or developer-facing project, you’ve probably wrestled with the same tradeoff: documentation tools that are either fast but limited, or flexible but slow. Rspress is built to close that gap.

Key Takeaways

  • Rspress is a React-based static site generator powered by Rspack’s Rust build toolchain, offering fast builds with full MDX support.
  • Version 2.0 introduces a layered theme system, build-time syntax highlighting with Shiki, lazy compilation by default, and AI-friendly Markdown output via SSG-MD.
  • All core packages are consolidated into @rspress/core, requiring Node.js 20+ and React 18 or 19.
  • Rspress is best suited for React-first documentation and component library sites; Vue or Svelte projects may be better served by VitePress or Docusaurus.

What Is Rspress?

Rspress is a React documentation generator and static site generator built on Rsbuild and powered by the Rspack bundler — a Rust-based, webpack-compatible bundler. To be precise: Rspress itself is a React framework, not a Rust application. The performance gains come from Rspack’s Rust-powered build toolchain underneath, while you write your docs and components in React and MDX as you normally would.

It’s part of the broader Rstack ecosystem — a unified JavaScript toolchain built around Rspack — which also includes Rsbuild, Rslib, Rsdoctor, and Rstest.

Rspress targets two primary use cases: developer documentation sites and component library documentation. It supports MDX out of the box, meaning you can embed live React components directly inside your Markdown pages — useful when you need interactive examples alongside written explanations.

What’s New in Rspress 2.0

Rspress 2.0, released in early 2026, goes beyond raw build performance. Here’s what changed.

A Redesigned Theme System

The default theme received a full visual overhaul. More importantly, 2.0 introduces four levels of customization:

  • CSS variables — adjust colors, code block backgrounds, and layout styles
  • BEM class names — override component styles without CSS framework conflicts
  • ESM re-export overrides — replace any built-in component via theme/index.tsx
  • Component eject — copy a component’s source into your project with rspress eject [component] and modify it directly

This replaces the unstable theme API from 1.x and gives you a predictable, layered customization path.

Shiki for Build-Time Syntax Highlighting

Rspress 2.0 replaces runtime highlighting with Shiki, which runs at compile time. This means zero runtime overhead, accurate VS Code-style highlighting via TextMate grammars, and support for transformers like @rspress/plugin-twoslash for inline TypeScript type hints.

Faster Dev Starts with Lazy Compilation

lazyCompilation is now enabled by default. Pages are only compiled when you visit them during development, which means startup is nearly instant regardless of how large your docs site is. A route preload strategy on link hover keeps navigation feeling seamless.

Persistent caching is also on by default, cutting warm-start build times by 30–60%.

AI-Friendly Documentation with SSG-MD

Rspress 2.0 introduces SSG-MD (Static Site Generation to Markdown) — a feature that renders your documentation as clean Markdown files alongside the standard HTML output, then generates llms.txt and llms-full.txt files following the llms.txt specification.

import { defineConfig } from '@rspress/core';

export default defineConfig({
  llms: true,
});

Unlike converting HTML to Markdown after the fact, SSG-MD works from the React virtual DOM during rendering, producing higher-quality output. You can also control what gets included per component using import.meta.env.SSG_MD. Note that this feature is still maturing, and the team has flagged further refinements as part of the roadmap.

Package Consolidation

In 2.0, the old rspress, @rspress/runtime, @rspress/shared, and @rspress/theme-default packages are merged into a single @rspress/core package. The framework now requires Node.js 20+ and React 18 or 19.

Should You Use Rspress?

Rspress is a strong fit if you’re building documentation for a React project or component library and want fast builds, MDX support, and a theme you can actually customize. It integrates directly with Rslib for component library workflows, and the plugin ecosystem — including Algolia search, sitemap generation, and twoslash — covers most documentation site needs.

If your project uses Vue or Svelte, or you need a more established ecosystem, VitePress or Docusaurus remain solid alternatives. But for React-first documentation, Rspress 2.0 is worth a close look.

FAQs

Rspress offers faster build times thanks to its Rust-powered Rspack bundler and ships with features like lazy compilation and persistent caching by default. Docusaurus has a larger plugin ecosystem and broader community. If raw build speed and tight Rstack integration matter most, Rspress is the stronger choice. For a more mature ecosystem, Docusaurus remains reliable.

Yes, but you will need to update your imports since all core packages are now consolidated under @rspress/core. The theme API has also changed, so any custom theme overrides built against the 1.x API will need to be refactored to use the new layered customization system. The Rspress team provides a migration guide in the official documentation.

No. Rspress is designed specifically for React and MDX. If your project uses Vue, VitePress is a well-supported alternative. For Svelte or other frameworks, you would need to look at different static site generators. Rspress focuses on doing React-first documentation well rather than trying to support multiple frameworks.

SSG-MD generates clean Markdown files from your documentation alongside the standard HTML output. It also produces llms.txt files that follow an emerging specification for making site content accessible to large language models. This is useful if you want AI tools to accurately reference your documentation. The feature works from the React virtual DOM for higher-quality output.

Gain Debugging Superpowers

Unleash the power of session replay to reproduce bugs, track slowdowns and uncover frustrations in your app. Get complete visibility into your frontend with OpenReplay — the most advanced open-source session replay tool for developers. Check our GitHub repo and join the thousands of developers in our community.

OpenReplay