desktop-multiwindow-tauri
Tauri Multi-Window & Events
Quick Guide: Create windows from JS with
new WebviewWindow(label, options)or from Rust withWebviewWindowBuilder. Communicate across windows using events:emit()broadcasts globally,emitTo(label, event, payload)targets a specific window,emit_filter()targets multiple windows by predicate. Always call the unlisten function returned bylisten(). Usetauri-plugin-window-stateto persist window position/size across sessions. Window labels must be unique and are used for both event targeting and permission scoping.Current version: Tauri 2.x (stable). Multi-webview in a single window requires the
unstablefeature flag.
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST give every window a unique label -- labels identify windows for event targeting, permissions, and retrieval)
(You MUST always call the unlisten function returned by listen() / once() -- leaked listeners cause memory leaks in long-running apps)
(You MUST check if a window already exists before creating it -- duplicate labels cause runtime errors)