Platform · tauri

Tauri

Windows, macOS and Linux as a small Rust binary on the webview the operating system provides. Downloads measured in megabytes, not hundreds of them.

  • Windows
  • macOS
  • Linux
kitr add tauri app

First time? Run npm i -g @kitr/kitr once. Inside a project, the global kitr runs your project's own version.

Built onTauri
// app/commands.ts
import { commandQuery, defineCommands } from '@kitr/tauri/client'

type Commands = { greet: (args: { name: string }) => string }
export const commands = defineCommands<Commands>()
export const greeting = commandQuery(commands.greet, 'greet')

await commands.greet({ name: 'kitr' })

Small and light

No browser ships with the app, so installers are small and memory use is low. The webview differs between Windows, macOS and Linux, so test on each.

Typed Rust commands

defineCommands() types your Rust commands for the app, and commandQuery turns one into a cached query like any other.

Events both ways

useTauriEvent() listens to events Rust emits, and emitTauri() sends one back. Both do nothing in a plain browser, so the web build is unchanged.

Checked before you build

Builds need the Rust toolchain. kitr doctor checks for it, and the Rust project lives in platforms/app/src-tauri for you to edit.

Same commands as every platform

Every platform answers to kitr dev, kitr build and kitr start, by the name you gave it. Leave the name off to run them all.

kitr dev app
the Tauri window over the Vite dev server
kitr build app
tauri build: a native bundle per OS
kitr doctor
checks the Rust toolchain

Electron or Tauri?

Both run the same app/ and register the same platform and storage drivers, so switching is one line in kitrrc.ts. A project keeps one of the two. Electron is the default we recommend.

See Electron →
ElectronTauri
Ships withIts own ChromiumThe OS webview
Installer sizeLarger (a browser inside)Small
RenderingIdentical on every OSCan differ between OSes
Native sideNode, over typed IPCRust commands and events
Build needsNode onlyThe Rust toolchain

Packages that work here

32 packages run on Tauri. Each one is a single kitr add away.

All packages →

Learn more

Start from a kit

A kit sets up the platforms, the packages and a first page in one command.

kitr new my-app --kit tauri

First time? Run npm i -g @kitr/kitr once. Inside a project, the global kitr runs your project's own version.

Add another platform

Platforms share the app/ folder, so adding one is a command, not a rewrite.

Mix and match →