---
title: "offset(x:y:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/visualeffect/offset(x:y:)"
---

# offset(x:y:)

Offsets the view by the specified horizontal and vertical distances.

## Declaration

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

```

## Parameters

- `x`: The horizontal distance to offset the view.
- `y`: The vertical distance to offset the view.

## Return Value

Return Value An effect that offsets the view by x and y.

## See Also

### Translating

- [offset(_:)](swiftui/visualeffect/offset(_:).md)
- [offset(z:)](swiftui/visualeffect/offset(z:).md)
