---
title: "MenuAnchorPosition.Custom"
description: "A custom positioning strategy"
type: "class"
lastmod: "2026-04-23T11:19:39.113727Z"
---
## API Reference

> Source set: Common

```kotlin
class Custom(
        val xCandidates: (anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList,
        val yCandidates: (anchorBounds: IntRect, windowSize: IntSize, menuSize: IntSize) -> IntList,
    ) : MenuAnchorPosition
```

A custom positioning strategy

This allows for dynamic positioning logic that can adapt to the anchor's location on screen,
the available window space, and the size of the menu content.

Please adjust [xCandidates](#xcandidates) and [yCandidates](#ycandidates) to the current [LayoutDirection](/jetpack-compose/androidx.compose.ui/ui-unit/classes/LayoutDirection) if needed.
