Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Desktop shell (Windows, Linux, macOS)

vard-desktop runs a Vard project in a native window. It uses the same core as vard run and draws with the GPU renderer, picking the backend per platform: DX12 or Vulkan on Windows, Vulkan or GL on Linux, Metal on macOS. Sources: crates/vard-desktop.

cargo run --release -p vard-desktop -- examples/todo            # a window; edits reload live
cargo run --release -p vard-desktop -- examples/patterns Animated --size 430x900
cargo run --release -p vard-desktop -- examples/showcase --shot out.png --scale 2   # offscreen PNG

The path can be a project folder, packages included (they are resolved like vard run does), or the output of vard bundle. The window reloads the project whenever a .vard, vard.toml, font or PNG file changes. ⌘R/Ctrl+R reloads by hand. Dropping a project folder onto the window opens that project instead.

What the host does

FeatureHow it works
Drawingwinit window + vard-gpu on the platform’s GPU API; redraws only after events, and on every frame while animations run
Mouseclick → tap, drag → scroll, wheel/trackpad → scroll, the back mouse button → back
Text inputthe host edits Input text: typing, IME commits, Backspace, Enter = onSubmit, Tab = next field, a blinking caret drawn by the renderer
KeysEsc leaves the field, or goes back while an on back handler is enabled; arrows / PageUp / PageDown scroll
Theme, languagethe window theme → isDark (and the app’s setColorScheme sets the window theme); LANG → locale
Lifecyclewindow focus → appResume / appPause
Preferencesprefs.json in the per-user config folder (~/Library/Application Support/vard/<app>, ~/.config/vard/<app>, %APPDATA%\vard\<app>)
Secure valuessecure.json next to it, readable by the user only (0600 on Unix). Not encrypted: use a real keychain for production secrets
URLs, share, notificationsopen / xdg-open / start; the clipboard (pbcopy, wl-copy/xclip, clip); osascript / notify-send
Permissionsnotifications is granted; device permissions answer denied (no desktop API is exposed yet)

platform is "windows", "linux" or "macos".

Native modules

vard-desktop is a small Rust program. To serve your own extern fns, wrap platform::DesktopHost in your own NativeHost that handles your names first. Callbacks are queued and delivered after the current event, the same way the std ones are.