Skip to content
Sign in
FramesSpatial windowMenu

Spatial windowPro

A floating spatial computing window: frosted glass hanging in a room, leaning toward the pointer, with a grabber, a close control and tab and toolbar ornaments.

ProA glass window in a room, with ornaments

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/spatial-window

Usage

tsx
import { SpatialWindow } from "@/components/ui/chatcn/pro/spatial-window"

<SpatialWindow label="Assistant" environment="/rooms/cafe.webp" onClose={close}>
  <YourApp />
</SpatialWindow>

The window is a platform material: dark frosted glass with a specular top edge and a soft shadow, and light text on it at all times (the kit tokens are set for it inside, so components render correctly on the glass). Ornaments float off its edges as their own glass. Drag the grabber to move the window; it settles back a little while held.

Examples

Every state

ProThinking, inactive, failed, fixed

Props

PropTypeNotes
labelstringThe window's accessible name
environmentstring | ReactNodeThe room behind. Image URL or node
windowWidth, windowHeightnumberDefault 560 x 360
width, heightnumber | stringThe stage. Height default 560
tiltbooleanLean toward the pointer. Default true
movablebooleanShow the grabber. Default true
offset, defaultOffset, onOffsetChange{ x, y }Position from the center
onClose() => voidShows the close control
activebooleanInactive windows recede. Default true
tabs, toolbarReactNodeOrnaments. Style buttons with spatialOrnamentButton

Keyboard

KeyAction
Arrow keys on the grabberMove the window 8 px, 32 px with Shift
Home on the grabberCenter the window
Enter, Space on closeClose

Accessibility

  • The window is a named group with aria-roledescription=window; ornaments are a named navigation and toolbar.
  • The grabber and close controls are labelled buttons with 44 px targets on touch.
  • In RTL the tab ornament moves to the other edge and arrow keys follow the reading direction.

Motion

  • The lean is at most 7 degrees and eases over 300 ms; it stops while dragging, on touch and on inactive windows.
  • Under reduced motion there is no lean and no settle, only fades.