API reference

SpatialWindow Component

Declares content that can be promoted into a separate spatial window. Render this component beneath <SpatialSceneProvider>. When spatial windowing is available, the system can promote its content using the requested size, placement, and priority. While the window is not promoted, fallback determines whether its content renders inline or is unmounted. Give each window a stable label when tracking its placement with useSpatialWindowState or rendering it conditionally. Nested spatial windows are not promotable and use their fallback inside the parent window. The same JSX is safe on every platform. Where spatial windowing is unavailable, 'inline' content remains in the React tree and 'drop' content remains unmounted.
Place a details panel beside the main window.
import {
OffsetNear,
SpatialWindow,
} from '@metavr/layout-window-compat';

<SpatialWindow
label="recipe-details"
windowWidth={360}
windowHeight="70%"
anchor="end"
offset={{y: OffsetNear}}>
<RecipeDetails />
</SpatialWindow>
Render a tool only when it holds a spatial slot.
import {SpatialWindow} from '@metavr/layout-window-compat';

<SpatialWindow
label="timers"
windowWidth={320}
windowHeight={480}
fallback="drop"
priority={10}>
<Timers />
</SpatialWindow>

Signature

SpatialWindow(props: SpatialWindowProps): React.ReactNode

Parameters

Returns

React.ReactNode