# MenuAnchorPosition

Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/Menu.kt+class:androidx.compose.material3.MenuAnchorPosition) Common/AllAndroid/JVM
- Cmn

  ```
  class MenuAnchorPosition
  ```

*** ** * ** ***

Class that determines the position of a menu relative to its anchor.

This allows selecting between standard positioning strategies (such as `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Above()`, `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Below()`, `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Start()`, `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#End()`, `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Left()`, `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Right()`) or providing a `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Custom(kotlin.Function1,kotlin.Function1)` implementation for complex positioning logic.

## Summary

| ### Public companion functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Custom(kotlin.Function1,kotlin.Function1)(xCandidates: https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuPositionScope.() -> https://developer.android.com/reference/kotlin/androidx/collection/IntList, yCandidates: https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuPositionScope.() -> https://developer.android.com/reference/kotlin/androidx/collection/IntList)` Create a custom positioning strategy by providing lambda functions for calculating candidate positions for the x and y axes. | Cmn |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Above()` Position the menu above its anchor. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Below()` Position the menu below its anchor. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#End()` Position the menu to the end of its anchor. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Left()` Position the menu to the left of its anchor. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Right()` Position the menu to the right of its anchor. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuAnchorPosition#Start()` Position the menu to the start of its anchor. | Cmn |

## Public companion functions

### Custom

Cmn

```
fun Custom(xCandidates: MenuPositionScope.() -> IntList, yCandidates: MenuPositionScope.() -> IntList): MenuAnchorPosition
```

Create a custom positioning strategy by providing lambda functions for calculating candidate positions for the x and y axes. Note that candidate positioning coordinates are calculated relative to the window bounds.

| Parameters |
|---|---|
| `xCandidates: https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuPositionScope.() -> https://developer.android.com/reference/kotlin/androidx/collection/IntList` | Lambda that determines the list of candidate x coordinates for the menu relative to the window bounds. |
| `yCandidates: https://developer.android.com/reference/kotlin/androidx/compose/material3/MenuPositionScope.() -> https://developer.android.com/reference/kotlin/androidx/collection/IntList` | Lambda that determines the list of candidate y coordinates for the menu relative to the window bounds. |

## Public companion properties

### Above

Cmn

```
val Above: MenuAnchorPosition
```

Position the menu above its anchor.

The menu's bottom edge is aligned with the anchor's top edge by default. If there is insufficient space, alternative positions (such as below the anchor) will be attempted.

### Below

Cmn

```
val Below: MenuAnchorPosition
```

Position the menu below its anchor.

The menu's top edge is aligned with the anchor's bottom edge by default. If there is insufficient space, alternative positions (such as above the anchor) will be attempted.

### End

Cmn

```
val End: MenuAnchorPosition
```

Position the menu to the end of its anchor.

In LTR layouts, this positions the menu on the right side of the anchor. In RTL layouts, this positions the menu on the left side of the anchor.

### Left

Cmn

```
val Left: MenuAnchorPosition
```

Position the menu to the left of its anchor.

This strategy positions the menu on the left side regardless of the layout direction.

### Right

Cmn

```
val Right: MenuAnchorPosition
```

Position the menu to the right of its anchor.

This strategy positions the menu on the right side regardless of the layout direction.

### Start

Cmn

```
val Start: MenuAnchorPosition
```

Position the menu to the start of its anchor.

In LTR layouts, this positions the menu on the left side of the anchor. In RTL layouts, this positions the menu on the right side of the anchor.