Composable Function

PlanarEmbeddedSubspace

Creates a 3D space for spatial content that is embedded within and positioned by a 2D container.

PlanarEmbeddedSubspace

Source set: Android
@Composable
@Suppress("COMPOSE_APPLIER_CALL_MISMATCH") // b/481422057
public fun PlanarEmbeddedSubspace(
    modifier: SubspaceModifier = SubspaceModifier,
    content: @Composable @SubspaceComposable SpatialBoxScope.() -> Unit,
)

Creates a 3D space for spatial content that is embedded within and positioned by a 2D container.

A PlanarEmbeddedSubspace acts as a bridge between a 2D layout context and a 3D spatial scene. It must be placed within a composable that provides a 2D surface in the 3D world, such as SpatialPanel, Orbiter, or a custom component built on similar principles.

The PlanarEmbeddedSubspace itself is laid out like a regular 2D composable, respecting the constraints and positioning of its parent. The 3D content placed inside it is then positioned relative to this 2D-defined area.

Key behaviors:

    constraints are inherited from the surrounding spatial environment, allowing content to extend forwards and backwards from the 2D surface.

  • Layout: The width and height are determined by the parent 2D layout. The depth (Z-axis)
  • elements like SpatialBox.

  • Content: The content lambda is a @SubspaceComposable scope, where you can place 3D
  • phones and tablets).

  • Environment: This composable is a no-op and renders nothing in non-XR environments (e.g.,

Parameters

modifier The SubspaceModifier to be applied to the content of this Subspace.
content The @SubspaceComposable 3D content to render within this subspace.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: