---
title: "Recipe: a floating Mac window"
description: "Use setWindowAlwaysOnTop(true) to float above ordinary Mac windows on the current Space."
modificationDate: "2026-11-24"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe: a floating Mac window

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/recipes/floating-window: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

Use `setWindowAlwaysOnTop(true)` to float above ordinary Mac windows on the
current Space. `setWindowIgnoreMouseEvents(true)` passes clicks to the window
underneath. A shortcut can turn click-through off again.
`setWindowOpacity(0.5, 250)` fades to half opacity over 250 milliseconds.
Omit the duration for an immediate change. Reduce Motion and the driver's
frozen clock also apply the opacity immediately.

A strip with `app-region="drag"` moves the window when dragged. Give a
button inside the strip `app-region="no-drag"` to keep it clickable.
A double click on drag ground takes the person's title-bar action. An
authored `dblclick` there takes precedence.

The three window commands are macOS commands. Other hosts journal the
refusal by name. The agent reports `floating`, `clickThrough` and `opacity`
in the window's state.

See [window bounds](https://exact.expo.dev/recipes/window-bounds.md) for docking and aspect lock.
```prompt Use this recipe in my app
Make the Exact app in this folder do what this recipe describes. Use https://github.com/expo/exact/blob/main/docs/recipes/floating-window.md as the source for each step. The Exact checkout has the same page at docs/recipes/floating-window.md.

1. If this folder is not an Exact app (it has no exact.mjs and app.contract), stop and tell me.
2. Read the recipe. If it leaves a choice that I did not make (which screen, which data, which platforms), propose one and ask me before you write code.
3. Do what the recipe says, in its order, with its tags, properties, functions and grants. Its component, state and URL names are examples. Change nothing else in the app.
4. Add a test in app.test.contract for each thing a person does that you changed. Copy the recipe's `contract-test` block where it has one. A drive operation the recipe shows (`call`, a ticket answer such as `tap @N accepted`) is not a test step: run it with `bun exact.mjs agent`.
5. Follow the platform checks in docs/start-here.md (`bun exact.mjs docs platform checks`) for the targets in the app's AGENTS.md and app.json until they pass. Read the reports, including counted findings; a zero exit code alone does not mean clean. Fix the app, not the test. If a finding stays after three rounds of fixes, or the app had it before you changed anything, record it (step 6) and report it; do not keep trying.
6. When a doc was wrong or missing, or a step needed a workaround, read `bun exact.mjs feedback status`. Under `never`, keep no note. Otherwise record it: `bun exact.mjs feedback note "<what happened>"`, which goes to Expo only as that status says. Do not change the policy; tell me how many notes you kept.
7. Tell me what you changed, what the tests and checks reported, and what I must still do by hand.
```
