<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/EnvironmentValues/showsWidgetContainerBackground",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17EnvironmentValuesV9WidgetKitE05showsE19ContainerBackgroundSbvp"
  },
  "title" : "showsWidgetContainerBackground"
}
-->

# showsWidgetContainerBackground

An environment variable that indicates whether the background of a widget appears.

```
var showsWidgetContainerBackground: Bool { get }
```

## Return Value

`true` if, by default, the background appears in this context;
`false` otherwise.

## Discussion

In iOS 16 and earlier, this environment variable is always `true` for system widgets and `false`
for accessory widgets. In macOS 13 and earlier, and in watchOS 9 and earlier, it always evaluates
to `true`.

If you pass `false` to <doc://com.apple.documentation/documentation/SwiftUI/WidgetConfiguration/containerBackgroundRemovable(_:)>
to always show the widget background, the system shows the widget background even if `showsWidgetContainerBackground` evaluates to `true`.

---

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)