Skip to content

Seamless element transitions between root, sheets, and navigation pushes in SwiftUI.

License

Notifications You must be signed in to change notification settings

iOS-Swift-Controls/Portal-transition-animations

 
 

Repository files navigation

Portal Logo

Portal

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

Demo

Example

Real Examples
StickerCaptureDemo.mp4
Amplify.Video.1914493323919650816.mp4

Features

  • 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 a PortalContainer.

  • .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 an Identifiable item's ID.

  • .portalTransition(id: isActive: ...)
    Drives the floating overlay animation based on a Binding<Bool> (isActive) and a static string id matching the source/destination.

  • .portalTransition(item: ...)
    Drives the floating overlay animation based on a Binding<Optional<Item>> (item), where Item is Identifiable. Automatically keys the transition to the item's ID.

  • Customizable Transitions
    Configure animations with PortalTransitionConfig 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.).

📚 Documentation

For full installation steps, usage guides, examples, and animation deep-dives, visit the Portal Wiki:


License

This project is released under the MIT License. See LICENSE for details.

Contributing

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.

Support

If you like this project, please consider giving it a ⭐️


Where to find me:


Built with 🍏🌀🚪 by Aether

About

Seamless element transitions between root, sheets, and navigation pushes in SwiftUI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%