# swift-rust

> The full-stack React framework powered with Rust + Bun. TSX-first, Rust rendering, 10x faster than Next.js, single binary deploy.

Latest version **1.11.3** (published 2026-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install swift-rust
pnpm add swift-rust
yarn add swift-rust
bun add swift-rust
```

Provides the command `swift-rust`.

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.11.3 |
| Published | 2026-10-17 |
| First published | 2026-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.0.0 |
| Dependencies | 8 |
| Unpacked size | 372.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 3 |
| Maintainers | cole5689 |
| Keywords | swift-rust, framework, rust, ssr, react |

## Links

- npm: https://www.npmjs.com/package/swift-rust
- Repository: https://github.com/colesites/swift-rust
- Homepage: https://swift-rust.dev
- Issues: https://github.com/colesites/swift-rust/issues
- npm.io page: https://npm.io/package/swift-rust

## Dependencies (8)

- [react](https://npm.io/package/react.md) ^19.0.0
- [react-dom](https://npm.io/package/react-dom.md) ^19.0.0
- [@swift-rust/env](https://npm.io/package/@swift-rust/env.md) ^0.2.2
- [@swift-rust/pdf](https://npm.io/package/@swift-rust/pdf.md) ^0.2.3
- [@dotenvx/dotenvx](https://npm.io/package/@dotenvx/dotenvx.md) ^2.38.0
- [@swift-rust/font](https://npm.io/package/@swift-rust/font.md) ^0.3.2
- [@swift-rust/image](https://npm.io/package/@swift-rust/image.md) ^1.1.2
- [@swift-rust/video](https://npm.io/package/@swift-rust/video.md) ^0.2.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.11.3 (latest) — 2026-10-17
- 1.11.2 — 2026-10-17
- 1.11.1 — 2026-10-17
- 1.11.0 — 2026-10-17
- 1.10.11 — 2026-07-19
- 1.10.10 — 2026-07-19
- 1.10.9 — 2026-07-19
- 1.10.8 — 2026-07-18
- 1.10.4 — 2026-06-30
- 1.10.3 — 2026-06-29
- 1.10.2 — 2026-06-14
- 1.8.0 — 2026-06-09
- 1.5.1 — 2026-06-05
- 1.5.0 — 2026-06-05
- 1.4.0 — 2026-06-05
- … 7 more at https://npm.io/package/swift-rust/versions

## README

# swift-rust

The main `swift-rust` npm package. Installing it in a project gives you:

- A `swift-rust` bin on `PATH` (or via `npx swift-rust`).
- Imports for `<Image>`, `<Font>`, `<Document>`, `<Head>`, `<Link>`, etc.
- A `defineConfig` helper for `swift-rust.config.json`.

The framework binary is downloaded at install time from GitHub Releases. If no prebuilt binary is available for the user's platform, `cargo build` is run as a fallback.

## Install

```bash
npm install swift-rust
# or
bun add swift-rust
# or
yarn add swift-rust
```

## Usage

### CLI

```bash
npx swift-rust dev      # start dev server
npx swift-rust build    # production build
npx swift-rust start    # start production server
npx swift-rust info     # print environment
```

### In code

```tsx
import { Image, Inter, Document, Page, Text, View } from "swift-rust";

const inter = Inter({ subsets: ["latin"] });

export default function Home() {
  return (
    <html lang="en" className={inter.className}>
      <body>
        <Image src="/hero.jpg" width={1200} height={600} alt="Hero" priority />
      </body>
    </html>
  );
}
```

## Subpath exports

| Path                    | What it exposes                                          |
| ----------------------- | -------------------------------------------------------- |
| `swift-rust`            | Everything (config, components, types).                  |
| `swift-rust/image`      | `<Image>` component + types.                             |
| `swift-rust/font`       | Font helpers + types.                                    |
| `swift-rust/font/google`| Google Fonts families.                                   |
| `swift-rust/font/local` | `localFont` for self-hosted fonts.                       |
| `swift-rust/pdf`        | `<Document>`, `<Page>`, `<Text>`, `<View>`.              |
| `swift-rust/env`        | Env loading + `SWIFT_RUST_PUBLIC_*` helpers.             |
| `swift-rust/router`     | Route handler types.                                     |
| `swift-rust/head`       | `<Head>` metadata.                                       |
| `swift-rust/link`       | `<Link>` client navigation.                              |

## Publishing

This package is built from `packages/swift-rust/` in the monorepo.

```bash
# 1. Build native binaries for all platforms
SWIFT_RUST_VERSION=0.1.0 bun run scripts/package-native.ts

# 2. Publish to npm
cd packages/swift-rust
bun publish
```

The `prepublishOnly` script runs both steps automatically.

---
_Source: https://npm.io/package/swift-rust · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
