---
title: "ornament(attachmentAnchor:contentAlignment:ornament:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/customhovereffect/ornament(attachmentanchor:contentalignment:ornament:)"
---

# ornament(attachmentAnchor:contentAlignment:ornament:)

Presents an ornament on hover.

## Declaration

```swift
nonisolated static func ornament<Content>(attachmentAnchor: OrnamentAttachmentAnchor, contentAlignment: Alignment3D = .center, @ContentBuilder ornament: () -> Content) -> OrnamentHoverEffect<Content> where Self == OrnamentHoverEffect<Content>, Content : View
```

## Parameters

- `attachmentAnchor`: The positioning anchor that defines the attachment point of the ornament.
- `contentAlignment`: The alignment of the ornament with its attachment anchor.
- `ornament`: The content of the ornament.

## Discussion

Discussion Use this method to show an ornament at the specified position when the view is hovered. The ornament will be shown with the default fade animation.
