FloatingHandle
Defined in: ui/src/floating.ts:30
One live floating element. The owner parents content into container;
the overlay re-anchors it to getReference() every frame and asks the
owner-supplied setLayout callback for the content’s shrink-to-content
size — so the overlay stays agnostic of how that content is built (React
reconciler tree, hand-built UIPanels, …).
Properties
Section titled “Properties”container
Section titled “container”
readonlycontainer:DisplayContainer
Defined in: ui/src/floating.ts:31
Methods
Section titled “Methods”bringToFront()
Section titled “bringToFront()”bringToFront():
void
Defined in: ui/src/floating.ts:52
Restack above all current floats (call when (re)opening).
Returns
Section titled “Returns”void
invalidateLayout()
Section titled “invalidateLayout()”invalidateLayout():
void
Defined in: ui/src/floating.ts:48
Re-run content layout on the next overlay update.
Call this after changing content without replacing the layout callback. Trigger movement, viewport changes, config changes, and reopening are detected automatically.
Returns
Section titled “Returns”void
release()
Section titled “release()”release():
void
Defined in: ui/src/floating.ts:53
Returns
Section titled “Returns”void
setActive()
Section titled “setActive()”setActive(
active):void
Defined in: ui/src/floating.ts:50
Show/position (true) or hide (false) without releasing.
Parameters
Section titled “Parameters”active
Section titled “active”boolean
Returns
Section titled “Returns”void
setConfig()
Section titled “setConfig()”setConfig(
cfg):void
Defined in: ui/src/floating.ts:33
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
setLayout()
Section titled “setLayout()”setLayout(
fn):void
Defined in: ui/src/floating.ts:40
Supply how the float’s content is laid out shrink-to-content for a given
maxWidth (undefined → natural width). Returns the stacked size. The
React side feeds reconciler roots through layoutFloat; the imperative
side lays out the node it parented in.
Parameters
Section titled “Parameters”(maxWidth) => Dimensions
Returns
Section titled “Returns”void
setReference()
Section titled “setReference()”setReference(
get):void
Defined in: ui/src/floating.ts:32
Parameters
Section titled “Parameters”() => UIElement | null
Returns
Section titled “Returns”void