explaingit

herotransitions/hero

22,455SwiftAudience · developerComplexity · 2/5StaleLicenseSetup · easy

TLDR

Swift library that animates transitions between iOS screens by matching elements across views, like Keynote's Magic Move feature.

Mindmap

mindmap
  root((Hero))
    What it does
      Animates screen transitions
      Matches elements across views
      Simplifies iOS navigation
    How it works
      Identifier-based matching
      Automatic transformations
      Custom entry/exit animations
    Use cases
      Product image expansion
      Tab transitions
      Custom navigation flows
    Tech stack
      Swift language
      iOS and tvOS
      Standard controllers
    Installation
      CocoaPods
      Carthage
      Swift Package Manager

Things people build with this

USE CASE 1

Animate a product thumbnail expanding to fill the next screen when tapped.

USE CASE 2

Create smooth tab transitions with custom animations between different sections.

USE CASE 3

Build polished navigation flows where UI elements morph between screens automatically.

USE CASE 4

Simplify complex view controller transitions without writing low-level iOS animation code.

Tech stack

SwiftiOStvOSCocoaPodsCarthageSwift Package Manager

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose including commercial, as long as you keep the copyright notice.

In plain English

Hero is a Swift library for iOS and tvOS that makes it easy to create smooth, animated transitions between screens (called view controllers) in a mobile app. Normally, animating elements as they move from one screen to another requires a lot of complex iOS-specific code. Hero simplifies this dramatically. The core idea works similarly to Keynote's "Magic Move" feature: you give matching elements on two different screens the same identifier. When the user navigates from one screen to the other, Hero automatically animates those elements, smoothly moving, scaling, or transforming them from their position on screen one to their position on screen two. Elements that don't have a matching pair can be given separate entry or exit animations. You would use Hero when building an iOS app that needs polished screen transitions, for instance, tapping on a product thumbnail that then expands to fill the next screen, or transitioning between tabs with a custom animation. Hero works with standard iOS navigation controllers, tab bar controllers, collection views, table views, and storyboards. The library is written in Swift, targets iOS and tvOS, and can be installed via CocoaPods, Carthage, or Swift Package Manager.

Copy-paste prompts

Prompt 1
Show me how to set up Hero transitions in my iOS app using matching identifiers between two view controllers.
Prompt 2
How do I use Hero to animate a collection view cell expanding into a detail screen?
Prompt 3
Create a Hero transition where a button on screen A animates to a different position on screen B.
Prompt 4
What's the simplest way to add Hero to my existing iOS project with CocoaPods?
Prompt 5
How do I customize entry and exit animations for elements that don't have matching pairs in Hero?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.