Arrange 3D space with subspaces

Applicable XR devices
This guidance helps you build experiences for these types of XR devices.
XR Headsets
Wired XR Glasses

A subspace is a partition of 3D space within your app where you can place 3D content, build 3D layouts, and add depth to otherwise 2D content. A subspace is rendered only when spatialization is enabled. In Home Space or on non-XR devices, any code within a subspace is ignored.

There are multiple ways to create a subspace:

  • Use a Subspace: This composable creates a new, independent spatial UI hierarchy. It doesn't inherit the spatial position, orientation, or scale of any parent Subspace it is nested within. A Subspace is automatically bound by the system's recommended content box. Using this composable, you can choose either to create a standard subspace that stays at a fixed position, or a subspace that follows a target.
  • Use a PlanarEmbeddedSubspace: This composable can be placed within your app's UI hierarchy, letting you maintain layouts for 2D and spatial UI. PlanarEmbeddedSubspace respects the constraints and positioning of its parent. The 3D content placed inside it is then positioned relative to this 2D-defined area.

Guides

This section includes the following developer guides: