Skip to content

@loc/electron-window

Manage Electron windows with React components. Children render via portals — your providers, themes, and state work inside child windows automatically.

Getting Started

Install the package and wire up the three required files — main, preload, and renderer.

Install & Setup →

Props Reference

Every <Window> prop: lifecycle, geometry, appearance, behavior, events, platform, and advanced.

Browse Props →

Hooks

Reactive hooks for window state. Use useCurrentWindow() for imperative control.

View Hooks →

Window Pooling

Pre-warm hidden windows for instant display. Ideal for overlays, HUDs, and menus.

Learn Pooling →

Persistence

Save and restore window bounds across sessions with a single prop.

View Persistence →

Testing

Mock providers, mock windows, and event simulation for unit tests.

Testing Guide →

Security

Enforced webPreferences, origin allowlist, per-renderer ownership.

Security Model →

Patterns

Unsaved-changes prompts, window refs, Radix/Framer integration notes.

Common Patterns →