On a learning platform, a course card should expand into the course detail view. How do you design that shared-element transition, and when would you avoid one?
answer
- same object in both views
- pick what persists, fade the rest
- container grows into the page
- back reverses to the same card
- fallback when source is missing
basics
~20 sKeep only what is the same object in both views, such as image and title, continuous; grow the card into the page, fade the rest, reverse on back, and use a plain transition when the card is off screen.
solid answer
~50 sA shared-element transition tells the learner that the detail page is the very card they tapped. I start by choosing what persists: only elements that are genuinely the same thing in both views, usually the course image and title. The card's container then grows into the page's bounds while its own contents crossfade to the detail layout; elements that exist in only one view fade rather than fly. The image needs a planned crop, because a thumbnail and a page header image rarely share an aspect ratio. Back must reverse the path into the same card in the same scroll position. I avoid it when the source card is off screen, filtered out or absent, as after a deep link; when the destination is a different object; or when the detail page cannot show its shared parts immediately.
go deeper
Recall what a shared-element transition communicates: the new view is the same object you tapped, seen more closely.
Explain how to choose shared elements, why the container grows while contents crossfade, and why back must reverse into the same card.
Show the failure cases you would design for, such as deep links, filtered or scrolled-away cards and late data, and the fallback for each.
Discuss how the system defines container and navigation transitions as distinct relationships so teams do not pick one per screen by taste.
## What a shared-element transition is A **shared-element transition** animates an element that appears in two views so that it seems to travel from its place in the first view to its place in the second. A **container transition** is the related pattern in which a whole surface, such as a card, grows or shrinks into another surface, such as a full page, with its contents changing inside it. Both serve **spatial continuity**: they tell the user that the new view is not a new place but a closer look at the thing they chose. This question is about the design decisions. How to animate the layout change without jank (measuring the start and end positions and animating between them cheaply) belongs to the web performance subject. ## Designing the card-to-course transition 1. **Decide what is shared.** Only elements that are the same object in both views: the course image and the course title are good candidates. A "save" icon on the card and a large enrol button on the page are not the same element, even if they sit in a similar place. 2. **Grow the container.** The card's outline expands to the detail view's bounds. This is what carries the relationship: the page *is* the card, opened up. 3. **Crossfade the contents.** Inside the growing container, the card's layout fades out while the page's layout fades in. Elements unique to one view (the card's rating row, the page's syllabus) fade rather than travel. 4. **Plan the image crop.** A thumbnail is often square or wide; the page header may be much wider. Letting the image stretch between aspect ratios distorts it. Design the transition as a change of crop or mask on an image that keeps its proportions. 5. **Keep the rest of the catalogue quiet.** The surrounding cards should fade or recede, not animate independently, so the eye stays on the card that is opening. 6. **Reverse on back.** Returning collapses the page into the same card, at the same place in the same scroll position. A back transition that lands on a different position breaks the promise the forward transition made. ## When the transition cannot keep its promise | Situation | Why it fails | Better choice | |---|---|---| | Learner opened the course from a deep link or notification | There is no card to grow from | The standard navigation transition | | On return, the card has been filtered out or scrolled away | The reverse path has no destination | Standard back transition, then restore scroll | | "Related course" link on a detail page | The target is a different object, so continuity would lie | A forward navigation transition | | Detail page's shared parts load late | The morph stalls on an empty frame | Show shared parts from data already held by the card, or skip the morph | | Many elements marked as shared | Several things fly at once and none reads as "the" object | Share one or two elements, fade the rest | The common thread: **a shared-element transition is a claim that the same object persists**. Use it only when the claim is true and both ends are on screen to prove it. ## How this differs from ordinary navigation motion - Ordinary forward navigation (a push or slide) says "you moved to a new place, one level deeper". - A container transition says "you are looking more closely at the thing you chose". Both are legitimate; they express different relationships. A system usually offers both and says when each applies, rather than letting each team pick whichever looks better. ## Across platforms Web and native mobile both have ways to animate an element between two screens, and the design decisions above are the same on each: what is shared, how the container grows, what fades, how back reverses, and what happens when one end is missing. A design system describes the transition in those terms so each platform implements the same choreography. ## Common mistakes - Marking elements as shared because they look similar, not because they are the same object. - Stretching an image between different aspect ratios instead of designing the crop. - A forward transition with a fancy morph and a back transition that simply cuts, so the relationship is only half told. - Forcing the morph when the source card is missing, which produces an element flying in from nowhere. - Letting every card in the grid respond at once, so the learner loses track of the one they tapped.
- The detail page fetches its data after navigation starts. How does that affect the transition?The shared parts should come from data the card already holds, so the image and title can be drawn at both ends immediately. Content unique to the page can fade in when it arrives. If even the shared parts must wait for the network, the morph stalls on an empty frame, and a standard transition with a loading state is the honest choice.
- Why is a shared-element transition wrong for a related-course link on a course page?Because the destination is a different course, not a closer view of the element tapped. Continuity motion would tell the learner that the related course is the same object in a new form. Ordinary forward navigation communicates the true relationship: a new place, reached from here.
- What should happen if the learner returns and the original card is no longer in the catalogue view?Do not invent a destination. Use the standard back transition and restore the catalogue's scroll position as closely as possible. Collapsing the page toward an empty slot or a different card would break the spatial model the forward transition established.
It is like a camera zooming in on an object in a wide shot: the audience knows the close-up shows the same object. Cut to a different object with the same zoom and the audience is misled, which is why a related-course link should not reuse the morph.
saying these in an interview costs you the question
- Treats every element that looks alike in both views as shared.
- Lets the course image stretch between different aspect ratios.
- Animates forward with a morph but cuts back without any reverse.
- Uses the same morph for a link to a different course.
- Forces the transition even when the source card is off screen.