<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/ornament(visibility:attachmentAnchor:contentAlignment:ornament:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE8ornament10visibility16attachmentAnchor16contentAlignmentADQrAA10VisibilityO_AA018OrnamentAttachmentG0VAA11Alignment3DVqd__yXEtAaBRd__lF"
  },
  "title" : "ornament(visibility:attachmentAnchor:contentAlignment:ornament:)"
}
-->

# ornament(visibility:attachmentAnchor:contentAlignment:ornament:)

Presents an ornament.

```
@export(implementation) nonisolated func ornament<Content>(visibility: Visibility = .automatic, attachmentAnchor: OrnamentAttachmentAnchor, contentAlignment: Alignment3D = .back, @ContentBuilder ornament: () -> Content) -> some View where Content : View
```

## Parameters

`visibility`

The visibility of the ornament.

`attachmentAnchor`

The positioning anchor that defines the
attachment point of the ornament.

`contentAlignment`

The alignment of the ornament with its attachment anchor.

## Discussion

Use this method to show an ornament at the specified position.
The example below displays an ornament below the window:

```
Text("A view with an ornament")
    .ornament(attachmentAnchor: .scene(.bottom)) {
        OrnamentContent()
    }
```

---

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)