---
title: "configure(world:portalEntity: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/configure(world:portalentity:surfacestyle:boundarystyle:boundarymode:)"
---

# configure(world:portalEntity:surfaceStyle:boundaryStyle:boundaryMode:)

Configures an existing pair of entities as a portal and its target world.

## Declaration

```swift
static func configure(world: Entity, portalEntity: Entity, surfaceStyle: PortalComponent.SurfaceStyle, boundaryStyle: PortalComponent.BoundaryStyle = .infinitePlane(), boundaryMode: PortalComponent.BoundaryMode = .disabled)
```

## Parameters

- `world`: The entity that contains the portal’s content. Place portal world descendants under this entity.
- `portalEntity`: The entity that displays the portal surface in the host scene.
- `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.

## Discussion

Discussion This method writes a coordinated set of components onto the two entities you provide. Use it when you already own both entities — for example, when the portal entity holds gestures or other components, or when the world entity is a child of an existing scene. On the world entity, this method sets: WorldComponent On the portal entity, this method sets: ModelComponent with a flat plane mesh sized by surfaceStyle, applied with PortalMaterial PortalComponent with clippingMode and crossingMode configured from boundaryStyle and boundaryMode This method replaces any existing WorldComponent, ModelComponent, or PortalComponent on the entities. Other components on either entity are preserved. To create both entities at once, use makePortal(surfaceStyle:boundaryStyle:boundaryMode:) instead.
