<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Shape/offset(x:y:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5ShapePAAE6offset1x1yAA06OffsetC0VyxG14CoreFoundation7CGFloatV_ALtF"
  },
  "title" : "offset(x:y:)"
}
-->

# offset(x:y:)

Changes the relative position of this shape using the specified point.

```
nonisolated func offset(x: CGFloat = 0, y: CGFloat = 0) -> OffsetShape<Self>
```

## Parameters

`x`

The horizontal amount, in points, by which you offset the shape.
Negative numbers are to the left and positive numbers are to the
right.

`y`

The vertical amount, in points, by which you offset the shape.
Negative numbers are up and positive numbers are down.

## Return Value

A shape offset by the specified amount.

## Discussion

The following example renders two circles. It places one circle at its
default position. The second circle is outlined with a stroke,
positioned on top of the first circle and offset by 100 points to the
left and 50 points below.

```
Circle()
.overlay(
    Circle()
    .offset(x: -100, y: 50)
    .stroke()
)
```

---

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)