<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/matchedTransitionSource(id:in:configuration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE23matchedTransitionSource2id2in13configurationQrqd___AA9NamespaceV2IDVqd_0_AA012EmptyMatchedeF13ConfigurationVXEtSHRd__AA0mefN0Rd_0_r0_lF"
  },
  "title" : "matchedTransitionSource(id:in:configuration:)"
}
-->

# matchedTransitionSource(id:in:configuration:)

Identifies this view as the source of a navigation transition, such
as a zoom transition.

```
nonisolated func matchedTransitionSource(id: some Hashable, in namespace: Namespace.ID, configuration: (EmptyMatchedTransitionSourceConfiguration) -> some MatchedTransitionSourceConfiguration) -> some View
```

## Parameters

`id`

The identifier, often derived from the identifier of
the data being displayed by the view.

`namespace`

The namespace in which defines the `id`. New
namespaces are created by adding an [`Namespace`](/documentation/SwiftUI/Namespace) variable
to a [`View`](/documentation/SwiftUI/View) type and reading its value in the view’s body
method.

`configuration`

A closure that you can use to apply styling to the source.

## Discussion

The appearance of the source can be configured using the
`configuration` trailing closure. Any modifiers applied will
be smoothly interpolated when a zoom transition originates from
this matched transition source.

```
MyView()
    .matchedTransitionSource(id: someID, in: someNamespace) { source in
        source
            .cornerRadius(8.0)
    }
```

---

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)