Skip to main content

Common Examples

To use the Window, pass the required chat slot. Add header, rail, and artifact as needed. Docked, the window shows header and chat. Fullscreen, it reveals the full shell. header and chat keep the same React instance across the transition.

Open control

Uncontrolled, the window owns open state, seeded by defaultOpen (true). Pass open and onOpenChange to control it from a store.

Maximize and restore

Uncontrolled size is seeded by defaultState ("docked"). Pass state and onStateChange to own it. useAppSurface().maximize() and restore() drive the same transitions.

Window states

Docked is a non-modal floating panel. Fullscreen is a modal takeover over a scrim. Esc or scrim click returns to docked.

Drag

Spread dragHandleProps from useAppSurface() onto a leading header action. The dragged position survives maximize and restore, and resets to the default corner only on close. The props are inert when fullscreen.

Region intents

showArtifact() and showRail() from a docked window maximize first, then open the region, in one call. The same AppSurfaceHandle is documented on AppShell.

Internationalization

Window owns ai-kit.window.label as the accessible name of the fullscreen dialog. Override it with aria-label. Region chrome uses the AppShell message IDs.

React Accessibility

  • Fullscreen traps focus over a scrim. Esc restores to docked.
  • Docked drag also supports arrow-key nudging through dragHandleProps.
  • The fullscreen dialog’s accessible name defaults to the localized window label.
Last modified on August 28, 2026