
Portal is a SwiftUI package for seamless element transitions between views—including across sheets and navigation pushes (NavigationStack, .navigationDestination, etc)—using a portal metaphor for maximum flexibility.
Compatible with iOS 15.0 and later
Real Examples
StickerCaptureDemo.mp4
Amplify.Video.1914493323919650816.mp4
-
DocC Documentation
-
PortalContainer { ... }
Manages the overlay window logic required for floating portal animations across hierarchies. -
.portalContainer()
View extension for easily wrapping any view hierarchy in aPortalContainer
. -
.portal(id:, .source/.destination)
Marks a view as source or destination anchor for a portal transition using a static string identifier. -
.portal(item:, .source/.destination)
Marks a view as source or destination anchor for a portal transition, keyed by anIdentifiable
item's ID. -
.portalTransition(id: isActive: ...)
Drives the floating overlay animation based on aBinding<Bool>
(isActive
) and a static stringid
matching the source/destination. -
.portalTransition(item: ...)
Drives the floating overlay animation based on aBinding<Optional<Item>>
(item
), whereItem
isIdentifiable
. Automatically keys the transition to the item's ID. -
Customizable Transitions
Configure animations withPortalTransitionConfig
for fine-grained control over timing, easing, and corner styling. -
iOS 17 Optimized
Takes advantage of modern SwiftUI features like Environment values and completion criteria on iOS 17+. -
iOS 15+ Compatible
Maintains backward compatibility with iOS 15-16 using fallback implementations. -
No custom presentation modifiers required
Works directly with standard SwiftUI presentation methods (.sheet
,.navigationDestination
, etc.).
For full installation steps, usage guides, examples, and animation deep-dives, visit the Portal Wiki:
This project is released under the MIT License. See LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request. Before you begin, take a moment to review the Contributing Guide for details on issue reporting, coding standards, and the PR process.
If you like this project, please consider giving it a ⭐️
Built with 🍏🌀🚪 by Aether