---
title: "Menu Section | Explore SwiftUI"
description: "A Section inside a Menu. Learn how to use Menu Section in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/menu/menu-section"
meta:
  author: "Explore SwiftUI"
  "og:description": "A Section inside a Menu. Learn how to use Menu Section in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Menu%2BSection%2Cdescription_A%2BSection%2Binside%2Ba%2BMenu%2Ccategory_Menu%2Cimage_~L2FwaS9pbWFnZXMvMTkvdmFyaWFudHMvNDE2P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyIsInZpc2lvbk9TIl19%2Cp_Ii9saWJyYXJ5L21lbnUvbWVudS1zZWN0aW9uIg%2Cs_QuM01k8AIJdmtVqD.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Menu Section | Explore SwiftUI"
  "twitter:description": "A Section inside a Menu. Learn how to use Menu Section in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Menu%2BSection%2Cdescription_A%2BSection%2Binside%2Ba%2BMenu%2Ccategory_Menu%2Cimage_~L2FwaS9pbWFnZXMvMTkvdmFyaWFudHMvNDE2P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyIsInZpc2lvbk9TIl19%2Cp_Ii9saWJyYXJ5L21lbnUvbWVudS1zZWN0aW9uIg%2Cs_QuM01k8AIJdmtVqD.png"
  "twitter:title": "Menu Section | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=19)

# **Menu Section**

A Section inside a Menu

![Menu Section - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/19/variants/416?v=1790073478842&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 13.0+ iPadOS 13.0+ macOS 10.15+ watchOS 6.0+ tvOS 13.0+ visionOS 1.0+

### **Tags**

### **SwiftUI Code**

[ Docs](https://developer.apple.com/documentation/swiftui/section)

```
Menu {
    Button("Button 1", action: action)
    Section("foo") {
        Button("Button 2", systemImage: "button.vertical.left.press", action: action)
        Button(action: action) {
            Text("Button 3")
            Text("Description 3")
        }
    }
} label: {
    Text("Buttons")
}
```

### **Found an issue or have a suggestion?**

Created: May 30, 2025Updated: December 27, 2025

![Connect Wizard](https://exploreswiftui.com/_ipx/f_webp&q_80&s_48x48/images/connect-wizard-icon.png)

**Connect Wizard**

**Unlock insights App Store Connect doesn’t show you.**

[** Get Started **](https://apps.apple.com/app/apple-store/id6747314580?pt=121213751&ct=Explore%20SwiftUI%20Banner&mt=8)

### **More Menu Components **

[**View all **](https://exploreswiftui.com/library/menu)

![Context Menu Preview - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/25/variants/159?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Context Menu Preview**

A context menu with custom preview

![Menu Action Button - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/23/variants/141?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Menu Action Button**

Acts like a button and opens the menu on a secondary gesture

![Context Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/22/variants/147?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Context Menu**

Adds a context menu to a view.

![Nested Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/21/variants/151?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Nested Menu**

A Menu inside a Menu

![Menu Divider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/20/variants/128?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Menu Divider**

A Menu with a Divider

![Menu Fixed Order - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/18/variants/132?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Menu Fixed Order**

Order items from top to bottom

![Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/17/variants/122?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Menu**

A control for presenting a menu of actions.

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![UIKit Label Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/10/variants/45?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Label Colors**

![Multiple Sources Toggle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/209/variants/633?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Multiple Sources Toggle**

Creates a toggle that updates the selected property for all sources. Once toggled, all sources will have the same value.

![Custom Slider Ticks - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/86/variants/375?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Custom Slider Ticks**

Creates a slider to select a value from a given range, subject to a step increment, which displays the provided labels and customizable ticks.

![Overlay Arrangement Edge - iOS on iPhone Duo - Landscape - Partially Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/251/variants/1787?v=1790586084694&r=2&w=412&q=75&f=webp)

### **Overlay Arrangement Edge**

The horizontal edge a view in an overlay arrangement occupies when the arrangement transitions to a horizontal layout. In this case, the primary view overlays the secondary view at the trailing edge when the screen is partially open in landscape.

![CompactProductViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/207/variants/516?v=1790073478842&r=2&w=412&q=75&f=webp)

### **CompactProductViewStyle**

A style for a product view that’s suitable for layouts with less available space, or for displaying more items in a small amount of space.

![InlinePickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/179/variants/574?v=1790073478842&r=2&w=412&q=75&f=webp)

### **InlinePickerStyle**

A PickerStyle where each option is displayed inline with other views in the current container.

![Capsule Text Field - macOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/240/variants/186?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Capsule Text Field**

Gives your text field a capsule shape. This only has a visible effect on macOS, where the capsule shape is not the default.

![EditButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/36/variants/239?v=1790073478842&r=2&w=412&q=75&f=webp)

### **EditButton**

A button that toggles the edit mode environment value

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/menu/menu-section#webpage","@type":"WebPage","dateModified":"2025-12-27T16:06:40.014Z","datePublished":"2025-05-30T06:09:55.506Z","description":"A Section inside a Menu. Learn how to use Menu Section in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Menu Section","url":"https://exploreswiftui.com/library/menu/menu-section","breadcrumb":{"@id":"https://exploreswiftui.com/library/menu/menu-section#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/menu/menu-section"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/menu/menu-section#article","dateModified":"2025-12-27T16:06:40.014Z","datePublished":"2025-05-30T06:09:55.506Z","description":"A Section inside a Menu. Learn how to use Menu Section in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","headline":"Menu Section","inLanguage":"en-US","name":"Menu Section","thumbnailUrl":"https://exploreswiftui.com/api/images/19/variants/416?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/menu/menu-section","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@type":"WebSite","name":"Explore SwiftUI","url":"https://exploreswiftui.com"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/menu/menu-section#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/menu/menu-section#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/section","codeSampleType":"full example","description":"A Section inside a Menu. Learn how to use Menu Section in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Menu Section SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"Menu {\n    Button(\"Button 1\", action: action)\n    Section(\"foo\") {\n        Button(\"Button 2\", systemImage: \"button.vertical.left.press\", action: action)\n        Button(action: action) {\n            Text(\"Button 3\")\n            Text(\"Description 3\")\n        }\n    }\n} label: {\n    Text(\"Buttons\")\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Menu"},{"@type":"Thing","name":"Menu Section"}]},{"@id":"https://exploreswiftui.com/library/menu/menu-section#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"Menu","item":"https://exploreswiftui.com/library/menu","position":2},{"@type":"ListItem","name":"Menu Section","item":"https://exploreswiftui.com/library/menu/menu-section","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/19/variants/416?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/19/variants/416?v=1790073478842&r=2"}]}
```