Homelogologo
Sponsor

FloatingPanel

A draggable and resizable floating panel.

Usage

A complex component designed for windows that users can interactively reposition and resize.

import { FloatingPanel } from "@elemnts-ui/react"; <FloatingPanel.Root> <FloatingPanel.Trigger /> <FloatingPanel.Positioner> <FloatingPanel.Content> <FloatingPanel.Header> <FloatingPanel.DragTrigger /> <FloatingPanel.Control> <FloatingPanel.StageTrigger /> <FloatingPanel.CloseTrigger /> </FloatingPanel.Control> </FloatingPanel.Header> <FloatingPanel.Body></FloatingPanel.Body> <FloatingPanel.ResizeTrigger axis="se" /> </FloatingPanel.Content> </FloatingPanel.Positioner> </FloatingPanel.Root>;

Dragging and Resizing

By wrapping the Title with DragTrigger, you enable the header to act as a handle for moving the panel. ResizeTrigger components can be added to any of the 8 cardinal and ordinal directions using the axis prop.

API Reference

FloatingPanelRoot

The root component that wraps the panel content and handles positioning.

PropTypeDefault
allowOverflowbooleantrue
closeOnEscapebooleanundefined
defaultOpenbooleanfalse
defaultPositionPointundefined
defaultSizeSizeundefined
dir'ltr' | 'rtl'ltr
disabledbooleanundefined
draggablebooleantrue
finalFocusEl() => HTMLElement | nullundefined
getAnchorPosition(details: AnchorPositionDetails) => Pointundefined
getBoundaryEl() => HTMLElement | nullundefined
gridSizenumberundefined
hideModeHideModedisplay-none
immediatebooleanundefined
initialFocusEl() => HTMLElement | nullundefined
lockAspectRatiobooleanundefined
maxSizeSizeundefined
minSizeSizeundefined
onExitCompleteVoidFunctionundefined
onOpenChange(details: OpenChangeDetails) => voidundefined
onPositionChange(details: PositionChangeDetails) => voidundefined
onPositionChangeEnd(details: PositionChangeDetails) => voidundefined
onSizeChange(details: SizeChangeDetails) => voidundefined
onSizeChangeEnd(details: SizeChangeDetails) => voidundefined
onStageChange(details: StageChangeDetails) => voidundefined
openbooleanundefined
persistRectbooleanundefined
positionPointundefined
presentbooleanundefined
resizablebooleantrue
restoreFocusbooleantrue
sizeSizeundefined
skipAnimationOnMountbooleanfalse
strategy'absolute' | 'fixed'fixed
translationsIntlTranslationsundefined
unmountOnExitbooleanfalse

FloatingPanelTrigger

The trigger component that toggles the panel.

PropTypeDefault
asChildbooleanfalse

FloatingPanelPositioner

The positioner component that handles the panel's positioning.

PropTypeDefault
asChildbooleanfalse

FloatingPanelContent

The content component that wraps the panel's content.

PropTypeDefault
asChildbooleanfalse

FloatingPanelHeader

The header component that contains the panel's title and controls.

PropTypeDefault
asChildbooleanfalse

FloatingPanelDragTrigger

The trigger component that enables dragging the panel.

PropTypeDefault
asChildbooleanfalse

FloatingPanelControl

The control component that contains the panel's controls.

PropTypeDefault
asChildbooleanfalse

FloatingPanelStageTrigger

The trigger component that toggles the panel stage.

PropTypeDefault
asChildbooleanfalse
stageStageundefined

FloatingPanelCloseTrigger

The trigger component that closes the panel.

PropTypeDefault
asChildbooleanfalse

FloatingPanelBody

The body component that contains the panel's main content.

PropTypeDefault
asChildbooleanfalse

FloatingPanelResizeTrigger

The trigger component that enables resizing the panel.

PropTypeDefault
asChildbooleanfalse
axisAxisundefined