---
title: "GroupBox With Label | Explore SwiftUI"
description: "A GroupBox with Label. Learn how to use GroupBox With Label in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/groupbox/groupbox-with-label"
meta:
  author: "Explore SwiftUI"
  "og:description": "A GroupBox with Label. Learn how to use GroupBox With Label in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_GroupBox%2BWith%2BLabel%2Cdescription_A%2BGroupBox%2Bwith%2BLabel%2Ccategory_GroupBox%2Cimage_~L2FwaS9pbWFnZXMvMjgvdmFyaWFudHMvMTk1P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ2aXNpb25PUyJdfQ%2Cp_Ii9saWJyYXJ5L2dyb3VwYm94L2dyb3VwYm94LXdpdGgtbGFiZWwi%2Cs_TEUSS9JKZVq64g9v.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "GroupBox With Label | Explore SwiftUI"
  "twitter:description": "A GroupBox with Label. Learn how to use GroupBox With Label in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_GroupBox%2BWith%2BLabel%2Cdescription_A%2BGroupBox%2Bwith%2BLabel%2Ccategory_GroupBox%2Cimage_~L2FwaS9pbWFnZXMvMjgvdmFyaWFudHMvMTk1P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ2aXNpb25PUyJdfQ%2Cp_Ii9saWJyYXJ5L2dyb3VwYm94L2dyb3VwYm94LXdpdGgtbGFiZWwi%2Cs_TEUSS9JKZVq64g9v.png"
  "twitter:title": "GroupBox With Label | Explore SwiftUI"
---

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

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

# **GroupBox With Label**

A GroupBox with Label

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

### **Platform Compatibility**

iOS 14.0+ iPadOS 14.0+ macOS 10.15+ visionOS 1.0+

### **Tags**

### **SwiftUI Code**

[ Docs](<https://developer.apple.com/documentation/swiftui/groupbox/init(content:label:)>)

```
GroupBox {
    Text(loremIpsum)
} label: {
    Label("Hello World", systemImage: "globe")
}
```

### **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 GroupBox Components **

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

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

### **GroupBox Background**

Set a custom GroupBox background

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

### **GroupBox**

A simple GroupBox

### **Explore Other Components **

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

![Toolbar Item Visibility Priority - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/238/variants/733?v=1792389091475&r=2&w=412&q=75&f=webp)

### **Toolbar Item Visibility Priority**

Defines the visibility priority for a toolbar item.

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

### **TextFieldLink**

A control that requests text input from the user when pressed

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

### **Tab Badge**

Generates a badge for a tab from an integer value.

![HelpLink - macOS - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/77/variants/30?v=1790073478842&r=2&w=412&q=75&f=webp)

### **HelpLink**

A button with a standard appearance that opens app-specific help documentation

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

### **Store View**

Creates a view to load and merchandise a collection of products from the App Store using product identifiers. Internally, ProductView is used, and therefore productViewStyle can also be applied here.

![Collapse Sidebar Sections by Default - iPadOS - Landscape - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/259/variants/2039?v=1792566366133&r=2&w=412&q=75&f=webp)

### **Collapse Sidebar Sections by Default**

Collapses the section in the sidebar by default.

![Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/257/variants/1987?v=1792070676534&r=2&w=412&q=75&f=webp)

### **Container Content Margins**

Adds the margins of the container the view is in.

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

### **UIKit Fill Colors**

```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/groupbox/groupbox-with-label#webpage","@type":"WebPage","dateModified":"2025-12-27T13:58:00.726Z","datePublished":"2025-05-30T11:26:09.510Z","description":"A GroupBox with Label. Learn how to use GroupBox With Label in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"GroupBox With Label","url":"https://exploreswiftui.com/library/groupbox/groupbox-with-label","breadcrumb":{"@id":"https://exploreswiftui.com/library/groupbox/groupbox-with-label#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/groupbox/groupbox-with-label"]}],"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/groupbox/groupbox-with-label#article","dateModified":"2025-12-27T13:58:00.726Z","datePublished":"2025-05-30T11:26:09.510Z","description":"A GroupBox with Label. Learn how to use GroupBox With Label in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","headline":"GroupBox With Label","inLanguage":"en-US","name":"GroupBox With Label","thumbnailUrl":"https://exploreswiftui.com/api/images/28/variants/195?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/groupbox/groupbox-with-label","@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/groupbox/groupbox-with-label#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/groupbox/groupbox-with-label#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/groupbox/init(content:label:)","codeSampleType":"full example","description":"A GroupBox with Label. Learn how to use GroupBox With Label in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"GroupBox With Label SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"GroupBox {\n    Text(loremIpsum)\n} label: {\n    Label(\"Hello World\", systemImage: \"globe\")\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"GroupBox"},{"@type":"Thing","name":"GroupBox With Label"}]},{"@id":"https://exploreswiftui.com/library/groupbox/groupbox-with-label#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"GroupBox","item":"https://exploreswiftui.com/library/groupbox","position":2},{"@type":"ListItem","name":"GroupBox With Label","item":"https://exploreswiftui.com/library/groupbox/groupbox-with-label","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/28/variants/195?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/28/variants/195?v=1790073478842&r=2"}]}
```