---
title: "rect(_:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/anchor/source/rect(_:)"
---

# rect(_:)

Returns an anchor source rect defined by r in the current view.

## Declaration

```swift
static func rect(_ r: CGRect) -> Anchor<Value>.Source
```

## See Also

### Getting rectangle anchor sources

- [bounds](swiftui/anchor/source/bounds.md)
