---
title: "subscript(_:)"
framework: realitykit
role: symbol
role_heading: Instance Subscript
path: "realitykit/entity/componentset/subscript(_:)"
---

# subscript(_:)

Gets or sets the component with a specific dynamically supplied type.

## Declaration

```swift
@MainActor @preconcurrency subscript(componentType: any Component.Type) -> (any Component)? { get set }
```
