<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Model3D",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:19_RealityKit_SwiftUI7Model3DV"
  },
  "title" : "Model3D"
}
-->

# Model3D

A view that asynchronously loads and displays a 3D model.

```
struct Model3D<Content> where Content : View
```

## Overview

Use `Model3D` to embed a 3D model from a USD file or Reality
file in your SwiftUI app.

You can use methods on the [`ResolvedModel3D`](/documentation/RealityKit/ResolvedModel3D) type as well as
standard view modifiers to adjust the size of the model to fit your app’s
interface. Here, the [`resizable(_:)`](/documentation/RealityKit/ResolvedModel3D/resizable(_:)) method scales the
model to fit the current view.
Then, the <doc://com.apple.documentation/documentation/SwiftUI/View/aspectRatio(_:contentMode:)-771ow> view modifier adjusts
this resizing behavior to maintain the model’s original aspect ratio, rather
than scaling the `x`,` y`-, and `z` axes independently to fit the robot to the
full frame of the view.

```swift
 Model3D(named: "Robot-Drummer") { model in
     model
         .resizable()
         .aspectRatio(contentMode: .fit)
 } placeholder: {
     ProgressView()
 }
```

If loading from a remote URL, this view uses the shared
<doc://com.apple.documentation/documentation/Foundation/URLSession>
instance to load a model from the specified URL, and then display it.
For example, you can display a model that’s stored on a server:

```swift
 Model3D(url: URL(string: "https://example.com/robot.usdz")!)
     .frame(width: 300, height: 600)
```

Until the model loads, the view displays a standard placeholder that
fills the available space. After the load completes successfully, the view
updates to display the model. In the example above, the model is smaller
than the frame, and so appears smaller than the placeholder.

![A diagram that shows a grey box on the left, a robot drummer model on the
right, and an arrow pointing from the first to the second. The model
is about half the width of the grey box.](AsyncModel-1)

You can specify a custom placeholder using
[`init(url:content:placeholder:)`](/documentation/RealityKit/Model3D/init(url:content:placeholder:)). With this initializer, you can
also use the `content` parameter to manipulate the loaded model.
For example, you can add a modifier to make the loaded image resizable:

```swift
 let url = URL(string: "https://example.com/robot.usdz")!
 Model3D(url: url) { model in
     model.resizable()
 } placeholder: {
     ProgressView()
 }
 .frame(width: 50, height: 50)
```

For this example, [`Model3D`](/documentation/RealityKit/Model3D) shows a  <doc://com.apple.documentation/documentation/SwiftUI/ProgressView> first, and then the
model scaled to fit in the specified frame:

![A diagram that shows a progress view on the left, a robot drummer model
on the right, and an arrow pointing from the first to the
second.](AsyncModel-2)

> Important: You can’t apply ``doc://com.apple.RealityKit/documentation/RealityKit/ResolvedModel3D``-specific modifiers, like ``doc://com.apple.RealityKit/documentation/RealityKit/ResolvedModel3D/resizable(_:)``, directly to a `Model3D`. Instead, apply them to the
> `ResolvedModel3D` instance that your `content` closure gets when defining the view’s appearance.

To gain more control over the loading process, use the
[`init(url:transaction:content:)`](/documentation/RealityKit/Model3D/init(url:transaction:content:)) initializer, which takes a
`content` closure that receives a [`Model3DPhase`](/documentation/RealityKit/Model3DPhase) to indicate
the state of the loading operation. Return a view that’s appropriate
for the current phase:

```swift
 let url = URL(string: "https://example.com/robot.usdz")!
 Model3D(url: url) { phase in
     if let model = phase.model {
         model // Displays the loaded model.
     } else if phase.error != nil {
         Color.red // Indicates an error.
     } else {
         Color.blue // Acts as a placeholder.
     }
 }
```

## Topics

### Creating a Model3D

[`init(named:bundle:)`](/documentation/RealityKit/Model3D/init(named:bundle:))

Loads and displays a model by name, by searching through the specified
`Foundation/Bundle`.

[`init(named:bundle:content:placeholder:)`](/documentation/RealityKit/Model3D/init(named:bundle:content:placeholder:))

Loads and displays a modifiable model by name, by searching
through the specified <doc://com.apple.documentation/documentation/Foundation/Bundle>, using a custom placeholder
until the model loads.

[`init(named:bundle:transaction:content:)`](/documentation/RealityKit/Model3D/init(named:bundle:transaction:content:))

Loads and displays a modifiable model by name, by searching
through the specified <doc://com.apple.documentation/documentation/Foundation/Bundle>, in phases.

[`init(url:)`](/documentation/RealityKit/Model3D/init(url:))

Loads and displays a model from the specified URL.

[`init(url:content:placeholder:)`](/documentation/RealityKit/Model3D/init(url:content:placeholder:))

Loads and displays a modifiable model from the specified URL using
a custom placeholder until the model loads.

[`init(url:transaction:content:)`](/documentation/RealityKit/Model3D/init(url:transaction:content:))

Loads and displays a modifiable model from the specified URL in phases.

### Accessing content

[`init(named:bundle:content:placeholder:)`](/documentation/RealityKit/Model3D/init(named:bundle:content:placeholder:))

Loads and displays a modifiable model by name, by searching
through the specified <doc://com.apple.documentation/documentation/Foundation/Bundle>, using a custom placeholder
until the model loads.

[`init(url:content:placeholder:)`](/documentation/RealityKit/Model3D/init(url:content:placeholder:))

Loads and displays a modifiable model from the specified URL using
a custom placeholder until the model loads.



---

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)