<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIMenu/preferredElementSize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIMenu(py)preferredElementSize"
  },
  "title" : "preferredElementSize"
}
-->

# preferredElementSize

The size of the menu’s child elements.

```
var preferredElementSize: UIMenu.ElementSize { get set }
```

## Discussion

This property allows you to choose between different layouts in the context menu:

- The [`UIMenu.ElementSize.small`](/documentation/UIKit/UIMenu/ElementSize/small) size gives the menu a more compact, side-by-side appearance, allowing you to fit more actions in a single row.
- The [`UIMenu.ElementSize.medium`](/documentation/UIKit/UIMenu/ElementSize/medium) size gives the menu the side-by-side appearance, but shows additional detail for each action. The text-editing menu uses this element size to display the standard edit menu.
- The [`UIMenu.ElementSize.large`](/documentation/UIKit/UIMenu/ElementSize/large) size gives the menu its default, full-width appearance.

![Screenshots of menus that use the small, medium, and large element sizes. The menu using the small size contains four side-by-side icons in the top row, followed by full-size elements. The menu using the medium size contains three side-by-side icons with labels in the top row, followed by full-size elements. The menu using the large size only contains full-size elements.](images/com.apple.uikit/media-4047986@2x.png)

If you specify the [`UIMenu.ElementSize.small`](/documentation/UIKit/UIMenu/ElementSize/small) or [`UIMenu.ElementSize.medium`](/documentation/UIKit/UIMenu/ElementSize/medium) sizes, the menu displays any items beyond the first three (for medium) or four (for small) as full-size elements.

This property doesn’t have an effect if you build your app with Mac Catalyst.

> Related Sessions from WWDC22:
> Session 10071: [Adopt desktop-class editing interactions](https://developer.apple.com/wwdc22/10071)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)