<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/safeAreaBar(edge:alignment:spacing:content:)-9hwgb",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE11safeAreaBar4edge9alignment7spacing7contentQrAA12VerticalEdgeO_AA19HorizontalAlignmentV14CoreFoundation7CGFloatVSgqd__yXEtAaBRd__lF"
  },
  "title" : "safeAreaBar(edge:alignment:spacing:content:)"
}
-->

# safeAreaBar(edge:alignment:spacing:content:)

Shows the specified content as a custom bar above or below the modified
view.

```
nonisolated func safeAreaBar(edge: VerticalEdge, alignment: HorizontalAlignment = .center, spacing: CGFloat? = nil, @ContentBuilder content: () -> some View) -> some View
```

## Parameters

`edge`

The vertical edge of the view on which `content` is placed.

`alignment`

The alignment guide used to position `content`
horizontally.

`spacing`

Extra distance placed between the two views, or
nil to use the default amount of spacing.

`content`

A content builder function providing the view to display as a
custom bar.

## Return Value

A new view that displays `content` above or below the
modified view,
making space for the `content` view by vertically insetting the
modified view, adjusting the safe area and scroll edge effects to
match.

## Discussion

Similar to the `View/safeAreaInset(edge:alignment:spacing:content:)-4s51l`
modifier, the `content` view is anchored to the specified vertical
edge of the parent view and its height insets the safe area.

Additionally, it extends the edge effect of any scroll views affected by
the inset safe area.

---

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)