---
title: "Orbiter"
description: "A composable that creates an orbiter along the top or bottom edges of a view."
type: "composable"
---
## API Reference

### Orbiter

> Source set: Android

```kotlin
@Composable
@Deprecated(message = "Use an orbiter that takes an anchorPoint or a poseProvider.")
public fun Orbiter(
    position: ContentEdge.Horizontal,
    offset: Dp = 0.dp,
    offsetType: OrbiterOffsetType = OrbiterOffsetType.OuterEdge,
    alignment: Alignment.Horizontal = Alignment.CenterHorizontally,
    shape: SpatialShape = OrbiterDefaults.Shape,
    elevation: Dp = OrbiterDefaults.Elevation,
    shouldRenderInNonSpatial: Boolean = true,
    content: @Composable @UiComposable () -> Unit,
)
```

A composable that creates an orbiter along the top or bottom edges of a view.

Orbiters are floating elements that are typically used to control the content within spatial
panels and other entities that they're anchored to. They allow the content to have more space and
give users quick access to features like navigation without obstructing the main content.

The size of the [Orbiter](/jetpack-compose/androidx.xr.compose/compose/composable-functions/Orbiter/api) is constrained by the dimensions of the parent spatial component it is
anchored to (e.g., a `androidx.xr.compose.subspace.SpatialPanel`). If it's not placed within a
specific spatial component, it defaults to the main window's size. Consequently, an [Orbiter](/jetpack-compose/androidx.xr.compose/compose/composable-functions/Orbiter/api)'s
content cannot be larger than its parent's dimensions.

Example:
```
Orbiter(position = ContentEdge.Top, offset = 10.dp) {
Text("This is a top edge Orbiter")
}
```

#### Parameters

| | |
| --- | --- |
| position | The edge of the orbiter. Use [ContentEdge.Top](/jetpack-compose/androidx.compose.ui/ui-test/properties/top) or [ContentEdge.Bottom](/jetpack-compose/androidx.compose.ui/ui-test/properties/bottom). |
| offset | The offset of the orbiter based on the outer edge of the orbiter. |
| offsetType | The type of offset used for positioning the orbiter. |
| alignment | The alignment of the orbiter. Use `Alignment.CenterHorizontally` or `Alignment.Start` or `Alignment.End`. |
| shape | The shape of this Orbiter when it is rendered in 3D space. |
| elevation | The z-direction elevation level of this Orbiter. |
| shouldRenderInNonSpatial | In a non-spatial environment, if `true` the orbiter content is rendered as if the orbiter wrapper was not present and removed from the flow otherwise. In spatial environments, this flag is ignored. |
| content | The content of the orbiter. |

### Orbiter

> Source set: Android

```kotlin
@Composable
@Deprecated(message = "Use an orbiter that takes an anchorPoint or a poseProvider.")
public fun Orbiter(
    position: ContentEdge.Vertical,
    offset: Dp = 0.dp,
    offsetType: OrbiterOffsetType = OrbiterOffsetType.OuterEdge,
    alignment: Alignment.Vertical = Alignment.CenterVertically,
    shape: SpatialShape = OrbiterDefaults.Shape,
    elevation: Dp = OrbiterDefaults.Elevation,
    shouldRenderInNonSpatial: Boolean = true,
    content: @Composable @UiComposable () -> Unit,
)
```

A composable that creates an orbiter along the start or end edges of a view.

Orbiters are floating elements that are typically used to control the content within spatial
panels and other entities that they're anchored to. They allow the content to have more space and
give users quick access to features like navigation without obstructing the main content.

The size of the [Orbiter](/jetpack-compose/androidx.xr.compose/compose/composable-functions/Orbiter/api) is constrained by the dimensions of the parent spatial component it is
anchored to (e.g., a `androidx.xr.compose.subspace.SpatialPanel`). If it's not placed within a
specific spatial component, it defaults to the main window's size. Consequently, an [Orbiter](/jetpack-compose/androidx.xr.compose/compose/composable-functions/Orbiter/api)'s
content cannot be larger than its parent's dimensions.

Example:
```
Orbiter(position = ContentEdge.Start, offset = 10.dp) {
Text("This is a start edge Orbiter")
}
```

#### Parameters

| | |
| --- | --- |
| position | The edge of the orbiter. Use `ContentEdge.Start` or `ContentEdge.End`. |
| offset | The offset of the orbiter based on the outer edge of the orbiter. |
| offsetType | The type of offset used for positioning the orbiter. |
| alignment | The alignment of the orbiter. Use `Alignment.CenterVertically` or [Alignment.Top](/jetpack-compose/androidx.compose.ui/ui-test/properties/top) or [Alignment.Bottom](/jetpack-compose/androidx.compose.ui/ui-test/properties/bottom). |
| shape | The shape of this Orbiter when it is rendered in 3D space. |
| elevation | The z-direction elevation level of this Orbiter. |
| shouldRenderInNonSpatial | In a non-spatial environment, if `true` the orbiter content is rendered as if the orbiter wrapper was not present and removed from the flow otherwise. In spatial environments, this flag is ignored. |
| content | The content of the orbiter. |

### Orbiter

> Source set: Android

```kotlin
public fun Orbiter(
    anchorPoint: OrbiterAnchorPoint,
    offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
    shape: SpatialShape = OrbiterDefaults.Shape,
    content: @Composable @UiComposable () -> Unit,
)
```

A composable that creates an orbiter along the edge of a spatial component (e.g.
`androidx.xr.compose.subspace.SpatialPanel`).

Orbiters are floating elements that are typically used to control the content within spatial
panels and other entities that they're anchored to. They allow the content to have more space and
give users quick access to features like navigation without obstructing the main content.

The size of the `Orbiter` is constrained by the dimensions of its spatial parent. The spatial
parent of the Orbiter is determined based on where the Orbiter is declared. When the orbiter is
declared within:
* A [Subspace](/jetpack-compose/androidx.xr.compose/compose/composable-functions/Subspace/api), the nearest spatial component (e.g. `androidx.xr.compose.subspace.SpatialRow`,
`androidx.xr.compose.subspace.SpatialPanel`) is the spatial parent
* `setContent`, the main panel is the spatial parent

#### Parameters

| | |
| --- | --- |
| anchorPoint | The anchored position of the orbiter relative to the spatial component it is anchored to. [OrbiterAnchorPoint](/jetpack-compose/androidx.xr.compose/compose/classes/OrbiterAnchorPoint) is [LayoutDirection](/jetpack-compose/androidx.compose.ui/ui-unit/classes/LayoutDirection) aware. |
| offset | The offset of the orbiter based on the outer edge of the orbiter. |
| shape | The shape of this Orbiter when it is rendered in 3D space. |
| content | The content of the orbiter. |

### Orbiter

> Source set: Android

```kotlin
@Composable
public fun Orbiter(
    alignment: OrbiterAlignment,
    shape: SpatialShape = OrbiterDefaults.Shape,
    content: @Composable @UiComposable () -> Unit,
)
```

A composable that creates an orbiter along the edge or center of a parent spatial component.

Orbiters are floating elements that are typically used to control the content within spatial
panels and other entities that they're anchored to. They allow the content to have more space and
give users quick access to features like navigation without obstructing the main content.

Sizing constraints depend on where the orbiter is declared:
* Within a [Subspace](/jetpack-compose/androidx.xr.compose/compose/composable-functions/Subspace/api): the nearest parent spatial component (e.g.,
`androidx.xr.compose.subspace.SpatialPanel`) is the parent.
* Within `setContent`: the main panel is the parent.

#### Parameters

| | |
| --- | --- |
| alignment | alignment and offset configuration of the orbiter relative to the parent spatial component |
| shape | shape of the orbiter when rendered in 3D space |
| content | content to display inside the orbiter |

### Orbiter

> Source set: Android

```kotlin
public fun Orbiter(
    poseProvider: OrbiterPoseProvider,
    shape: SpatialShape = OrbiterDefaults.Shape,
    content: @Composable @UiComposable () -> Unit,
)
```

A composable that creates an orbiter along the edge of a spatial component (e.g.
`androidx.xr.compose.subspace.SpatialPanel`).

Orbiters are floating elements that are typically used to control the content within spatial
panels and other entities that they're anchored to. They allow the content to have more space and
give users quick access to features like navigation without obstructing the main content.

The size of the `Orbiter` is constrained by the dimensions of its spatial parent. The spatial
parent of the Orbiter is determined based on where the Orbiter is declared. When the orbiter is
declared within:
* A [Subspace](/jetpack-compose/androidx.xr.compose/compose/composable-functions/Subspace/api), the nearest spatial component (e.g. `androidx.xr.compose.subspace.SpatialRow`,
`androidx.xr.compose.subspace.SpatialPanel`) is the spatial parent
* `setContent`, the main panel is the spatial parent

Orbiters do not participate in their parent's layout and have no layout nodes in the containing
compose hierarchy.

#### Parameters

| | |
| --- | --- |
| poseProvider | A pose provider for calculating the offset pose of the orbiter relative to its spatial parent. |
| shape | The shape of this Orbiter when it is rendered in 3D space. |
| content | The content of the orbiter. |

## Code Examples

### OrbiterBottomBarSample

```kotlin
@Sampled
@Composable
@SubspaceComposable
public fun OrbiterBottomBarSample() {
    SpatialPanel(SubspaceModifier.width(400.dp).height(300.dp)) {
        // Place a horizontal bar orbiter at the bottom-center edge of the panel.
        Orbiter(
            alignment =
                OrbiterAlignment.BottomCenter(
                    offset = DpVolumeOffset(0.dp, (-20).dp, OrbiterDefaults.Elevation),
                    edgeOffsetType = OrbiterEdgeOffsetType.OuterEdge,
                )
        ) {
            Box(
                modifier = Modifier.size(200.dp, 64.dp).background(Color.DarkGray),
                contentAlignment = Alignment.Center,
            ) {
                Text("Bottom Bar", color = Color.White, fontSize = 18.sp)
            }
        }
    }
}
```

### OrbiterSideRailSample

```kotlin
@Sampled
@Composable
@SubspaceComposable
public fun OrbiterSideRailSample() {
    SpatialPanel(SubspaceModifier.width(400.dp).height(300.dp)) {
        // Place a vertical rail orbiter at the end-center (usually right) edge of the panel.
        Orbiter(
            alignment =
                OrbiterAlignment.CenterEnd(
                    offset = DpVolumeOffset(24.dp, 0.dp, OrbiterDefaults.Elevation),
                    edgeOffsetType = OrbiterEdgeOffsetType.OuterEdge,
                )
        ) {
            Box(
                modifier = Modifier.size(64.dp, 200.dp).background(Color.DarkGray),
                contentAlignment = Alignment.Center,
            ) {
                Text("Rail", color = Color.White, fontSize = 18.sp)
            }
        }
    }
}
```
