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

# position(x:y:)

Positions the center of this view at the specified coordinates in its parent’s coordinate space.

## Declaration

```swift
nonisolated func position(x: CGFloat = 0, y: CGFloat = 0) -> some View

```

## Parameters

- `x`: The x-coordinate at which to place the center of this view.
- `y`: The y-coordinate at which to place the center of this view.

## Mentioned in

Building layouts with stack views Making fine adjustments to a view’s position

## Return Value

Return Value A view that fixes the center of this view at x and y.

## Discussion

Discussion Use the position(x:y:) modifier to place the center of a view at a specific coordinate in the parent view using an x and y offset. Text("Position by passing the x and y coordinates")     .position(x: 175, y: 100)     .border(Color.gray)

## See Also

### Adjusting a view’s position

- [Making fine adjustments to a view’s position](swiftui/making-fine-adjustments-to-a-view-s-position.md)
- [position(_:)](swiftui/view/position(_:).md)
- [offset(_:)](swiftui/view/offset(_:).md)
- [offset(x:y:)](swiftui/view/offset(x:y:).md)
- [offset(z:)](swiftui/view/offset(z:).md)
