Platform · desktop

Desktop

Windows, macOS and Linux in an Electron shell. Chromium ships with the app, so it looks and behaves the same on every machine.

  • Windows
  • macOS
  • Linux
kitr add desktop app

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

Built onelectron-viteelectron-builder
// platforms/app/ipc.ts
export type Ipc = {
  'app.version': () => string
  'dialog.openFile': () => string | null
}

// app/ipc.ts
import { createIpcClient } from '@kitr/desktop/client'
export const ipc = createIpcClient<Ipc>()

const version = await ipc.invoke('app.version')

Your app, in a window

The same app/ folder runs in the shell. The main and preload processes live in platforms/app/, and electron-builder packages the installers.

Typed IPC

One schema in platforms/app/ipc.ts: handleIpc() implements it in main and createIpcClient() calls it from your components, typed both ways.

Storage that lives on disk

Storage items write to kitr-storage.json in the app data folder instead of localStorage. Your code does not change.

The recommended desktop shell

What you test is what every user runs. Pick Tauri instead when download size matters more than identical rendering.

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 Electron window, loading Vite on port 3200
kitr build app
electron-vite builds main, preload and the app
kitr start app
opens the built app

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 Tauri →
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 desktop. 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 desktop

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 →