Skip to content

WindowProps

Defined in: shared/types.ts:543

Window component props (renderer process)

optional alwaysOnTop: boolean | AlwaysOnTopLevel

Defined in: shared/types.ts:432

Whether the window should always be on top.

BaseWindowProps.alwaysOnTop


optional backgroundColor: string

Defined in: shared/types.ts:402

Background color

BaseWindowProps.backgroundColor


optional center: boolean

Defined in: shared/types.ts:370

Center the window on creation. Default: true if no x/y specified.

BaseWindowProps.center


children: ReactNode

Defined in: shared/types.ts:545

Content to render inside the window


optional closable: boolean

Defined in: shared/types.ts:310

Whether the user can close the window. Default: true. When false, the close button is hidden/disabled.

BaseWindowProps.closable


optional defaultHeight: number

Defined in: shared/types.ts:318

Initial height. Only applied on window creation.

BaseWindowProps.defaultHeight


optional defaultWidth: number

Defined in: shared/types.ts:315

Initial width. Only applied on window creation.

BaseWindowProps.defaultWidth


optional defaultX: number

Defined in: shared/types.ts:321

Initial x position. Only applied on window creation.

BaseWindowProps.defaultX


optional defaultY: number

Defined in: shared/types.ts:324

Initial y position. Only applied on window creation.

BaseWindowProps.defaultY


optional focusable: boolean

Defined in: shared/types.ts:429

Whether the window is focusable. Default: true.

BaseWindowProps.focusable


optional frame: boolean

Defined in: shared/types.ts:387

Show window frame (title bar, borders). Creation-only.

Cannot be changed after window creation.

BaseWindowProps.frame


optional fullscreen: boolean

Defined in: shared/types.ts:443

Enter/exit fullscreen mode

BaseWindowProps.fullscreen


optional fullscreenable: boolean

Defined in: shared/types.ts:446

Whether the window can enter fullscreen. Default: true.

BaseWindowProps.fullscreenable


optional height: number

Defined in: shared/types.ts:338

Controlled height. Changes will resize the window. Use with onBoundsChange for two-way sync.

BaseWindowProps.height


optional ignoreMouseEvents: boolean

Defined in: shared/types.ts:454

Ignore mouse events (click-through window)

BaseWindowProps.ignoreMouseEvents


optional injectStyles: InjectStylesMode

Defined in: shared/types.ts:502

How to inject styles into the new window.

  • “auto”: Copy
  • false: No injection (for CSS-in-JS)
  • function: Custom injection

BaseWindowProps.injectStyles


optional maxHeight: number

Defined in: shared/types.ts:367

Maximum height constraint

BaseWindowProps.maxHeight


optional maximizable: boolean

Defined in: shared/types.ts:426

Whether the window can be maximized. Default: true.

BaseWindowProps.maximizable


optional maxWidth: number

Defined in: shared/types.ts:361

Maximum width constraint

BaseWindowProps.maxWidth


optional minHeight: number

Defined in: shared/types.ts:364

Minimum height constraint

BaseWindowProps.minHeight


optional minimizable: boolean

Defined in: shared/types.ts:423

Whether the window can be minimized. Default: true.

BaseWindowProps.minimizable


optional minWidth: number

Defined in: shared/types.ts:358

Minimum width constraint

BaseWindowProps.minWidth


optional movable: boolean

Defined in: shared/types.ts:420

Whether the window is movable. Default: true.

BaseWindowProps.movable


optional name: string

Defined in: shared/types.ts:484

Debug name for DevTools and error messages. Useful for identifying windows in multi-window apps.

BaseWindowProps.name


optional onBlur: () => void

Defined in: shared/types.ts:525

Fired when the window loses focus

void

BaseWindowProps.onBlur


optional onBoundsChange: (bounds) => void

Defined in: shared/types.ts:353

Callback fired when window bounds change (resize or move). Debounced internally.

Bounds

void

BaseWindowProps.onBoundsChange


optional onClose: () => void

Defined in: shared/types.ts:528

Fired when the window is destroyed (for any reason — user close, programmatic, unmount)

void

BaseWindowProps.onClose


optional onDisplayChange: (display) => void

Defined in: shared/types.ts:537

Fired when window moves to a different display

DisplayInfo

void

BaseWindowProps.onDisplayChange


optional onEnterFullscreen: () => void

Defined in: shared/types.ts:531

Fired when window enters fullscreen

void

BaseWindowProps.onEnterFullscreen


optional onExitFullscreen: () => void

Defined in: shared/types.ts:534

Fired when window exits fullscreen (maps to Electron’s ‘leave-full-screen’ event)

void

BaseWindowProps.onExitFullscreen


optional onFocus: () => void

Defined in: shared/types.ts:522

Fired when the window gains focus

void

BaseWindowProps.onFocus


optional onMaximize: () => void

Defined in: shared/types.ts:510

Fired when window is maximized

void

BaseWindowProps.onMaximize


optional onMinimize: () => void

Defined in: shared/types.ts:516

Fired when window is minimized

void

BaseWindowProps.onMinimize


optional onReady: () => void

Defined in: shared/types.ts:507

Fired when window is ready and content is mounted

void

BaseWindowProps.onReady


optional onRestore: () => void

Defined in: shared/types.ts:519

Fired when window is restored from minimized

void

BaseWindowProps.onRestore


optional onUnmaximize: () => void

Defined in: shared/types.ts:513

Fired when window is unmaximized

void

BaseWindowProps.onUnmaximize


optional onUserClose: () => void

Defined in: shared/types.ts:304

Called when the user initiates a close (e.g., clicks the X button).

Fires during Electron’s close event — the window is about to close but hasn’t yet. Use this to sync your open state back to false. The window will close on its own; your open={false} is for your state consistency, not to drive the close.

This is a notification, not an interceptor. To prevent close, set closable={false} proactively (e.g., closable={!hasUnsavedChanges}).

onClose (a separate callback) fires after the window is fully destroyed, for any reason (user, programmatic, unmount).

void

BaseWindowProps.onUserClose


optional opacity: number

Defined in: shared/types.ts:405

Window opacity (0.0 to 1.0)

BaseWindowProps.opacity


open: boolean

Defined in: shared/types.ts:288

Whether the window should be open/visible. When true, the window is created/shown. When false, the window is destroyed.

BaseWindowProps.open


optional persistBounds: string

Defined in: shared/types.ts:492

Persist window bounds with this key. Bounds are saved on resize/move and restored on next open.

BaseWindowProps.persistBounds


optional recreateOnShapeChange: boolean

Defined in: shared/types.ts:478

Recreate window when creation-only props change. Default: false (log warning instead).

BaseWindowProps.recreateOnShapeChange


optional resizable: boolean

Defined in: shared/types.ts:417

Whether the window is resizable. Default: true.

BaseWindowProps.resizable


optional showInactive: boolean

Defined in: shared/types.ts:451

Show window without stealing focus

BaseWindowProps.showInactive


optional skipTaskbar: boolean

Defined in: shared/types.ts:438

Whether to skip showing in taskbar/dock.

BaseWindowProps.skipTaskbar


optional targetDisplay: TargetDisplay

Defined in: shared/types.ts:470

Which display to open the window on

BaseWindowProps.targetDisplay


optional title: string

Defined in: shared/types.ts:375

Window title

BaseWindowProps.title


optional titleBarOverlay: TitleBarOverlayOptions

Defined in: shared/types.ts:465

Title bar overlay options (Windows)

BaseWindowProps.titleBarOverlay


optional titleBarStyle: TitleBarStyle

Defined in: shared/types.ts:393

Title bar style. Creation-only.

Cannot be changed after window creation.

BaseWindowProps.titleBarStyle


optional trafficLightPosition: object

Defined in: shared/types.ts:462

Traffic light (close/minimize/maximize) button position (macOS)

x: number

y: number

BaseWindowProps.trafficLightPosition


optional transparent: boolean

Defined in: shared/types.ts:381

Make the window transparent. Creation-only.

Cannot be changed after window creation.

BaseWindowProps.transparent


optional vibrancy: VibrancyType

Defined in: shared/types.ts:399

Vibrancy effect (macOS only). Creation-only.

Cannot be changed after window creation.

BaseWindowProps.vibrancy


optional visible: boolean

Defined in: shared/types.ts:414

Whether the window is visible. Default: true. Set to false to hide the window without destroying it (state is preserved). Unlike open, which controls the window’s existence, visible controls whether it’s shown.

BaseWindowProps.visible


optional visibleOnAllWorkspaces: boolean

Defined in: shared/types.ts:457

Visible on all workspaces/virtual desktops

BaseWindowProps.visibleOnAllWorkspaces


optional width: number

Defined in: shared/types.ts:332

Controlled width. Changes will resize the window. Use with onBoundsChange for two-way sync.

BaseWindowProps.width


optional x: number

Defined in: shared/types.ts:344

Controlled x position. Changes will move the window. Use with onBoundsChange for two-way sync.

BaseWindowProps.x


optional y: number

Defined in: shared/types.ts:350

Controlled y position. Changes will move the window. Use with onBoundsChange for two-way sync.

BaseWindowProps.y