<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/safeAreaPadding(_:)-5lh9p",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE15safeAreaPaddingyQrAA10EdgeInsetsVF"
  },
  "title" : "safeAreaPadding(_:)"
}
-->

# safeAreaPadding(_:)

Adds the provided insets into the safe area of this view.

```
@export(implementation) nonisolated func safeAreaPadding(_ insets: EdgeInsets) -> some View
```

## Discussion

Use this modifier when you would like to add a fixed amount
of space to the safe area a view sees.

```
ScrollView(.horizontal) {
    HStack(spacing: 10.0) {
        ForEach(items) { item in
            ItemView(item)
        }
    }
}
.safeAreaPadding(.horizontal, 20.0)
```

See the horizontal
`View/safeAreaInset(edge:alignment:spacing:content:)-(HorizontalEdge,_,_,_)`
or vertical
`View/safeAreaInset(edge:alignment:spacing:content:)-(VerticalEdge,_,_,_)`
modifier for adding to the safe area based on the size of a view.

---

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)