---
title: body
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/view/body-8kl5o
---

# body

The content and behavior of the view.

## Declaration

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

## Mentioned in

Declaring a custom view

## Discussion

Discussion When you implement a custom view, you must implement a computed body property to provide the content for your view. Return a view that’s composed of built-in views that SwiftUI provides, plus other composite views that you’ve already defined: struct MyView: View {     var body: some View {         Text("Hello, World!")     } } For more information about composing views and a view hierarchy, see Declaring a custom view.

## See Also

### Implementing a custom view

- [Body](swiftui/view/body-swift.associatedtype.md)
- [modifier(_:)](swiftui/view/modifier(_:).md)
- [Previews in Xcode](swiftui/previews-in-xcode.md)
