<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/background(ignoresSafeAreaEdges:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE10background20ignoresSafeAreaEdgesQrAA4EdgeO3SetV_tF"
  },
  "title" : "background(ignoresSafeAreaEdges:)"
}
-->

# background(ignoresSafeAreaEdges:)

Sets the view’s background to the default background style.

```
nonisolated func background(ignoresSafeAreaEdges edges: Edge.Set = .all) -> some View
```

## Parameters

`edges`

The set of edges for which to ignore safe area insets
when adding the background. The default value is [`all`](/documentation/SwiftUI/Edge/Set/all).
Specify an empty set to respect safe area insets on all edges.

## Return Value

A view with the [`background`](/documentation/SwiftUI/ShapeStyle/background) shape style
drawn behind it.

## Discussion

This modifier behaves like [`background(_:ignoresSafeAreaEdges:)`](/documentation/SwiftUI/View/background(_:ignoresSafeAreaEdges:)),
except that it always uses the [`background`](/documentation/SwiftUI/ShapeStyle/background) shape style.
For example, you can add a background to a [`Label`](/documentation/SwiftUI/Label):

```
ZStack {
    Color.teal
    Label("Flag", systemImage: "flag.fill")
        .padding()
        .background()
}
```

Without the background modifier, the teal color behind the label shows
through the label. With the modifier, the label’s text and icon appear
backed by a region filled with a color that’s appropriate for light
or dark appearance:

![A screenshot of a flag icon and the word flag inside a rectangle; the](images/com.apple.SwiftUI/View-background-7@2x.png)

If you want to specify a [`View`](/documentation/SwiftUI/View) or a stack of views as the background,
use [`background(alignment:content:)`](/documentation/SwiftUI/View/background(alignment:content:)) instead.
To specify a [`Shape`](/documentation/SwiftUI/Shape) or [`InsettableShape`](/documentation/SwiftUI/InsettableShape), use
[`background(_:in:fillStyle:)`](/documentation/SwiftUI/View/background(_:in:fillStyle:)).
To configure the background of a presentation, like a sheet, use
[`presentationBackground(_:)`](/documentation/SwiftUI/View/presentationBackground(_:)).

---

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)