Composable Function

SpatialPanel

Creates a SpatialPanel representing a 2D plane in 3D space in which an application can fill content.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

SpatialPanel

Android
@Composable
@SubspaceComposable
public fun SpatialPanel(
    modifier: SubspaceModifier = SubspaceModifier,
    shape: SpatialShape = SpatialPanelDefaults.shape,
    dragPolicy: DragPolicy? = null,
    resizePolicy: ResizePolicy? = null,
    interactionPolicy: InteractionPolicy? = null,
    content: @Composable @UiComposable () -> Unit,
)

Creates a SpatialPanel representing a 2D plane in 3D space in which an application can fill content.

Parameters

modifier SubspaceModifiers to apply to the SpatialPanel.
shape The shape of this Spatial Panel.
dragPolicy An optional DragPolicy that defines the motion behavior of the SpatialPanel. This can be either a MovePolicy for free movement or an AnchorPolicy for anchoring to real-world surfaces. If a policy is provided, draggable UI controls will be shown, allowing the user to manipulate the panel in 3D space. If null, no motion behavior is applied.
resizePolicy An optional ResizePolicy that defines the resizing behavior of this SpatialPanel. If a policy is provided, resize UI controls will be shown, allowing the user to resize the element in 3D space. If null, no resize behavior is applied to the element.
interactionPolicy An optional InteractionPolicy that can be set to detect 3D input events. Setting this will not intercept 2D input events and is intended to provide additional spatial input information.
content The composable content to render within the SpatialPanel.