<!--
{
  "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/ShapeStyle/body",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10ShapeStylePA2A4ViewRzAA01_cE0VyAA9RectangleVxG4BodyAaDPRtzrlE4bodyAIvp"
  },
  "title" : "body"
}
-->

# body

A rectangular view that’s filled with the shape style.

```
var body: _ShapeView<Rectangle, Self> { get }
```

## Discussion

For a [`ShapeStyle`](/documentation/SwiftUI/ShapeStyle) that also conforms to the [`View`](/documentation/SwiftUI/View) protocol, like
[`Color`](/documentation/SwiftUI/Color) or [`LinearGradient`](/documentation/SwiftUI/LinearGradient), this default implementation of the
[`body`](/documentation/SwiftUI/View/body-8kl5o) property provides a visual representation
for the shape style. As a result, you can use the shape style in a view
hierarchy like any other view:

```
ZStack {
    Color.cyan
    Text("Hello!")
}
.frame(width: 200, height: 50)
```

![A screenshot of a cyan rectangle with the text hello appearing](images/com.apple.SwiftUI/ShapeStyle-body-1@2x.png)

---

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)