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
. -
.portalSource(id:)
Marks a view as the source anchor for a portal transition using a static string identifier. -
.portalSource(item:)
Marks a view as the source anchor for a portal transition, keyed by anIdentifiable
item's ID. -
.portalDestination(id:)
Marks a view as the destination anchor for a portal transition using a static string identifier. -
.portalDestination(item:)
Marks a view as the 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 -
No custom presentation modifiers required
Works directly with standard SwiftUI presentation methods (.sheet
,.navigationDestination
, etc.). -
iOS 15+ support
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