---
title: body
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/widget/body-swift.property
---

# body

The content and behavior of the widget.

## Declaration

```swift
@MainActor @preconcurrency var body: Self.Body { get }
```

## Discussion

Discussion For any widgets that you create, provide a computed body property that defines the widget as a composition of SwiftUI views. Swift infers the widget’s Body associated type based on the contents of the body property.

## See Also

### Implementing a widget

- [Body](swiftui/widget/body-swift.associatedtype.md)
