---
title: "GroupBox Background | Explore SwiftUI"
description: "Set a custom GroupBox background. Learn how to use GroupBox Background in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/groupbox/groupbox-background"
meta:
  author: "Explore SwiftUI"
  "og:description": "Set a custom GroupBox background. Learn how to use GroupBox Background in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_GroupBox%2BBackground%2Cdescription_Set%2Ba%2Bcustom%2BGroupBox%2Bbackground%2Ccategory_GroupBox%2Cimage_~L2FwaS9pbWFnZXMvMjkvdmFyaWFudHMvMTkwP3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyIsInZpc2lvbk9TIl19%2Cp_Ii9saWJyYXJ5L2dyb3VwYm94L2dyb3VwYm94LWJhY2tncm91bmQi%2Cs_HRkZiAEmwUFFBV1W.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "GroupBox Background | Explore SwiftUI"
  "twitter:description": "Set a custom GroupBox background. Learn how to use GroupBox Background in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_GroupBox%2BBackground%2Cdescription_Set%2Ba%2Bcustom%2BGroupBox%2Bbackground%2Ccategory_GroupBox%2Cimage_~L2FwaS9pbWFnZXMvMjkvdmFyaWFudHMvMTkwP3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyIsInZpc2lvbk9TIl19%2Cp_Ii9saWJyYXJ5L2dyb3VwYm94L2dyb3VwYm94LWJhY2tncm91bmQi%2Cs_HRkZiAEmwUFFBV1W.png"
  "twitter:title": "GroupBox Background | Explore SwiftUI"
---

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

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

# **GroupBox Background**

Set a custom GroupBox background

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

### **Platform Compatibility**

iOS 16.0+ iPadOS 16.0+ macOS 13.0+ watchOS 9.0+ tvOS 16.0+ visionOS 1.0+

### **Tags**

### **SwiftUI Code**

[ Docs](<https://developer.apple.com/documentation/swiftui/view/backgroundstyle(_:)>)

```
GroupBox {
    Text(loremIpsum)
}
.backgroundStyle(.blue.tertiary)
```

### **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 With Label - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/28/variants/195?v=1790073478842&r=2&w=412&q=75&f=webp)

### **GroupBox With Label**

A GroupBox with Label

![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/)

![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.

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

### **CheckboxToggleStyle**

A toggle style that displays a checkbox followed by its label.

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

### **LinearCapacityGaugeStyle**

A gauge style that displays a bar that fills from leading to trailing edges as the gauge’s current value increases

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

### **Picker Divider**

A Picker with a Divider

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

### **Glass Button Styles**

A button style that applies glass border artwork based on the button’s context

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

### **FieldDatePickerStyle**

A date picker style that displays the components in an editable field

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

### **LinearGaugeStyle**

A gauge style that displays a bar with a marker that appears at a point along the bar to indicate the gauge’s current value

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

### **Button Styles**

A type that applies standard interaction behavior and a custom appearance to all buttons within a view hierarchy

```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-background#webpage","@type":"WebPage","dateModified":"2025-12-27T13:57:30.085Z","datePublished":"2025-05-30T12:34:31.665Z","description":"Set a custom GroupBox background. Learn how to use GroupBox Background in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"GroupBox Background","url":"https://exploreswiftui.com/library/groupbox/groupbox-background","breadcrumb":{"@id":"https://exploreswiftui.com/library/groupbox/groupbox-background#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/groupbox/groupbox-background"]}],"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-background#article","dateModified":"2025-12-27T13:57:30.085Z","datePublished":"2025-05-30T12:34:31.665Z","description":"Set a custom GroupBox background. Learn how to use GroupBox Background in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","headline":"GroupBox Background","inLanguage":"en-US","name":"GroupBox Background","thumbnailUrl":"https://exploreswiftui.com/api/images/29/variants/190?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/groupbox/groupbox-background","@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-background#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/groupbox/groupbox-background#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/view/backgroundstyle(_:)","codeSampleType":"full example","description":"Set a custom GroupBox background. Learn how to use GroupBox Background in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"GroupBox Background SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"GroupBox {\n    Text(loremIpsum)\n}\n.backgroundStyle(.blue.tertiary)","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"GroupBox"},{"@type":"Thing","name":"GroupBox Background"}]},{"@id":"https://exploreswiftui.com/library/groupbox/groupbox-background#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 Background","item":"https://exploreswiftui.com/library/groupbox/groupbox-background","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/29/variants/190?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/29/variants/190?v=1790073478842&r=2"}]}
```