---
title: "ornament(visibility:attachmentAnchor:contentAlignment:ornament:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/ornament(visibility:attachmentanchor:contentalignment:ornament:)"
---

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

Presents an ornament.

## Declaration

```swift
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

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()     }

## See Also

### Creating an ornament

- [OrnamentAttachmentAnchor](swiftui/ornamentattachmentanchor.md)
