explaingit

herotransitions/hero

Analysis updated 2026-05-18

22,452SwiftAudience · developerComplexity · 2/5LicenseSetup · 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
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

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.

What is it built with?

SwiftiOStvOSCocoaPodsCarthageSwift Package Manager

How does it compare?

herotransitions/herocodeeditapp/codeeditswiftyjson/swiftyjson
Stars22,45222,83322,954
LanguageSwiftSwiftSwift
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get 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?

Frequently asked questions

What is hero?

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

What language is hero written in?

Mainly Swift. The stack also includes Swift, iOS, tvOS.

What license does hero use?

Use freely for any purpose including commercial, as long as you keep the copyright notice.

How hard is hero to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is hero for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub herotransitions on gitmyhub

Verify against the repo before relying on details.