<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/HoverEffectContent/offset(x:y:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI18HoverEffectContentPAAE6offset1x1yQr14CoreFoundation7CGFloatV_AItF"
  },
  "title" : "offset(x:y:)"
}
-->

# offset(x:y:)

Offsets the view by the specified horizontal and vertical distances.

```
func offset(x: CGFloat = 0, y: CGFloat = 0) -> some HoverEffectContent
```

## Parameters

`x`

The horizontal distance to offset the view.

`y`

The vertical distance to offset the view.

## Return Value

An effect that offsets the view by `x` and `y`.

---

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)