Skip to content

Props Reference

PropTypeDefaultDescription
openbooleanrequiredWhether the window exists. false destroys it.
visiblebooleantrueShow/hide without destroying. State is preserved.
closablebooleantrueWhether the user can close the window.
onUserClose() => voidUser clicked X. Fires once; sync your state here.
onClose() => voidWindow destroyed (any reason: user, programmatic, unmount).
onReady() => voidWindow ready and content mounted.

open controls existence. visible controls visibility. open={true} visible={false} creates a hidden window with state preserved. open={false} destroys everything.

PropTypeDescription
defaultWidth / defaultHeightnumberInitial size. Applied once on creation. User can resize freely.
defaultX / defaultYnumberInitial position. Applied once on creation.
width / heightnumberControlled size. Changes resize the window. Use with onBoundsChange.
x / ynumberControlled position. Changes move the window.
onBoundsChange(bounds) => voidFires on resize/move. Debounced internally (100ms).
minWidth / maxWidthnumberSize constraints.
minHeight / maxHeightnumberSize constraints.
centerbooleanCenter on creation. Default true when no position specified.

The default* / controlled split follows React’s defaultValue / value pattern. Use defaultWidth for fire-and-forget sizing, width + onBoundsChange for two-way sync.

PropTypeDefaultDescription
titlestring""Window title.
transparentbooleanfalseTransparent background. Creation-only.
framebooleantrueShow window chrome. Creation-only.
titleBarStylestring"hidden", "hiddenInset", etc. Creation-only.
vibrancystringmacOS vibrancy effect. Creation-only.
backgroundColorstringBackground color.
opacitynumberWindow opacity (0.0–1.0).

Creation-only props cannot change after the window is created. Changing them logs a dev warning. Set recreateOnShapeChange to destroy and recreate the window instead — note that this unmounts and remounts all children, so any useState/useRef inside them resets.

PropTypeDefault
resizablebooleantrue
movablebooleantrue
minimizablebooleantrue
maximizablebooleantrue
focusablebooleantrue
alwaysOnTopboolean | AlwaysOnTopLevelfalse
skipTaskbarbooleanfalse
fullscreenbooleanfalse
fullscreenablebooleantrue
showInactivebooleanfalse
ignoreMouseEventsbooleanfalse
visibleOnAllWorkspacesbooleanfalse

AlwaysOnTopLevel is a string union: "normal" | "floating" | "torn-off-menu" | "modal-panel" | "main-menu" | "status" | "pop-up-menu" | "screen-saver". Higher levels float above lower ones. true is equivalent to "floating".

PropFires when
onFocusWindow gains focus
onBlurWindow loses focus
onMaximize / onUnmaximizeMaximize state changes
onMinimize / onRestoreMinimize state changes
onEnterFullscreen / onExitFullscreenFullscreen changes
onDisplayChangeWindow moves to a different monitor
onBoundsChangeWindow resized or moved
PropPlatformDescription
trafficLightPositionmacOS{ x, y } for close/minimize/maximize buttons
titleBarOverlayWindows{ color, symbolColor, height }
targetDisplayall"primary", "cursor", or display index. Centers the window on that display when no explicit x/y.
PropTypeDefaultDescription
persistBoundsstringUnique key. Saves bounds to localStorage, restores on reopen.
recreateOnShapeChangebooleanfalseRecreate window when creation-only props change.
namestringDebug label for DevTools and warning messages.
injectStyles"auto" | false | (doc) => void"auto"How to copy styles into the child window. false for CSS-in-JS.

For persistBounds and the usePersistedBounds hook, see Persistence.