addDetachedGlass

Description

Add a detached glass — a floating panel inside the window, not bound to any pane. This is the programmatic equivalent of the detach action. It returns a promise that resolves to the glass element once the open animation finishes.

When no position is given, the glass cascades down-right from the active glass (or centers if there is none).

binaryWindow.addDetachedGlass(options);

In React, reach addDetachedGlass through the useWindow hook.

Parameters

options details

NameTypeDefaultDescription
positionstringcascadedAnchor: center, top-left, top-right, bottom-left, bottom-right
widthnumber200Glass width in px
heightnumber200Glass height in px
offsetnumber0Distance in px from the anchored corner/edge (no effect on center)
offsetX / offsetYnumber0Per-axis override of offset
idstringauto-generatedGlass id; used to remove it later
actionsobject[]minimize, attach, closeAction buttons
titlestring | DOM NodeHeader title
contentstring | DOM NodeGlass body content
draggablebooleantrueWhether the header can be dragged to move the glass
resizablebooleantrueWhether resize handles appear on hover
animatebooleantrueWhether to play the open animation

Returns

Type: Promise<Element>

Description: Resolves to the detached glass element once the open animation completes.

Examples

const glassEl = await binaryWindow.addDetachedGlass({
  title: 'Panel',
  content: 'Floating content',
});

See also