---
title: "makePortal(surfaceStyle:boundaryStyle:boundaryMode:)"
framework: realitykit
role: symbol
role_heading: Type Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "realitykit/portalcomponent/makeportal(surfacestyle:boundarystyle:boundarymode:)"
---

# makePortal(surfaceStyle:boundaryStyle:boundaryMode:)

Creates a portal entity and a world entity, and configures them.

## Declaration

```swift
static func makePortal(surfaceStyle: PortalComponent.SurfaceStyle, boundaryStyle: PortalComponent.BoundaryStyle = .infinitePlane(), boundaryMode: PortalComponent.BoundaryMode = .disabled) -> PortalComponent.Portal
```

## Parameters

- `surfaceStyle`: The size of the portal surface mesh.
- `boundaryStyle`: The shape of the clipping and crossing boundary. Defaults to doc://com.apple.RealityKit/documentation/RealityKit/PortalComponent/BoundaryStyle/infinitePlane().
- `boundaryMode`: The combination of clipping and crossing behaviors to enable. Defaults to doc://com.apple.RealityKit/documentation/RealityKit/PortalComponent/BoundaryMode/disabled.

## Return Value

Return Value A PortalComponent.Portal containing the new portal entity and world entity.

## Discussion

Discussion This is the simplest way to set up a portal. The returned PortalComponent.Portal value contains a fresh portal entity and a fresh world entity that you add to your scene. To add portal world content, parent it under the returned worldEntity. let portal = PortalComponent.makePortal(     surfaceStyle: .init(width: 0.5, height: 0.5),     boundaryStyle: .infinitePlane(),     boundaryMode: .clippingAndCrossing )

content.add(portal.worldEntity) content.add(portal.portalEntity) To configure entities you already own — for example, a portal entity that has gesture components, or a world entity that’s already in your scene hierarchy — use configure(world:portalEntity:surfaceStyle:boundaryStyle:boundaryMode:) instead.
