Motion and Interaction · Step 4 · 6 min read
Navigation transitions
Moving between screens is the biggest motion in most products, and the one people see most. How to choose a transition from the relationship between two screens, why entering is slower than leaving, the real durations and curves, and a push-and-back sketched in CSS with no script.
A navigation transition answers one question: how is this screen related to the one I just left? Deeper, sideways, or on top. Get the answer right and people feel they know where they are without reading a breadcrumb. Get it wrong, or animate everything the same way, and the motion becomes a delay people sit through dozens of times a day.
What you'll be able to do after reading:
- Pick a transition from the relationship between two screens
- Use Material's four patterns and the platform's own conventions
- Set durations and curves for entering and leaving, and say why they differ
- Build a push and back transition in CSS, with a reduced-motion version
1. Push, back and a tab switch
Inbox
The new icons are in the file
Files
Open a message, go back, then switch tabs. Keyboard: Tab to the message, Space; Tab to the tabs, arrow keys.
Open a message, go back, then switch tabs. Two different relationships, two different motions:
- Opening a message is going deeper. The detail pushes in from the right, over the list, and the list slides 30% to the left as if it stepped back. Going back reverses it exactly.
- Switching tabs is moving between equals. There's no "left of Files", so there's no slide: a 200 ms fade, nothing more.
2. Choose by relationship
| Pattern | Use it when the two screens are… | What moves | Example |
|---|---|---|---|
| Container transform | One thing, seen small and then big | The container of the card grows into the new screen; its contents cross-fade | A card in a list opens into its detail page |
| Shared axis | Steps in an order, or parent and child | Both screens slide together along one axis: x, y or z (depth) | Next and Back in onboarding (x); a stepper (y); parent to child (z) |
| Fade through | Not strongly related | The old screen fades out, then the new one fades in | Tapping another tab in the bottom bar |
| Fade | Not screens: something entering or leaving within this one | The element fades (and often scales a little) in place | A dialog, a menu, a snackbar |
Material's four transition patterns are a useful decision tool, because each one answers the relationship question (Material Design 3, Transition patterns). Its own examples: container transform for "a card into a details page", shared axis for "an onboarding flow", "a stepper" and "a parent-child navigation", fade through for "tapping destinations in a bottom navigation bar", and fade for "a dialog", "a menu" and "a snackbar" (Material Components for Android, Motion).
Notice that the fade is the default for anything without a strong relationship. A fade doesn't claim a direction, so it can't lie about the map.
3. Entering is slower than leaving
Look at the numbers in the figure: 400 ms to push in, 200 ms to go back.
- Entering brings new content that people need to read. It decelerates: fast at first, then settling gently, so the eye can land on the new screen. The curve is Material's emphasized decelerate,
cubic-bezier(0.05, 0.7, 0.1, 1), and 400 ms is itsmedium4token. - Leaving takes away something people are done with. It accelerates out of the way: emphasized accelerate,
cubic-bezier(0.3, 0, 0.8, 0.15), in 200 ms, theshort4token (Material Web, motion tokens). - Bigger movements take longer. Material's guidance is that duration should increase as the area or distance of an animation increases (Material Components for Android, Motion). A full-screen push is one of the biggest motions in an app, so it sits at the top of the range. A tab fade over the same area moves nothing, so 200 ms is plenty. The lessons on duration and Easing curves go deeper.
4. The code that runs
These are the rules from the figure, as they run:
.mo-b-scrn--list { transition: transform 200ms cubic-bezier(0.05, 0.7, 0.1, 1); } /* back: the list comes forward again, decelerating into place */
.mo-b-scrn--detail { z-index: 1; transform: translateX(100%); visibility: hidden; box-shadow: -8px 0 24px rgb(0 0 0 / .12); transition: transform 200ms cubic-bezier(0.3, 0, 0.8, 0.15), visibility 0s 200ms; }
.mo-b-nav:has(.mo-b-open:checked) .mo-b-scrn--detail { transform: none; visibility: visible; transition: transform 400ms cubic-bezier(0.05, 0.7, 0.1, 1), visibility 0s; }
.mo-b-nav:has(.mo-b-open:checked) .mo-b-scrn--list { transform: translateX(-30%); transition: transform 400ms cubic-bezier(0.05, 0.7, 0.1, 1); }
@media (prefers-reduced-motion: reduce) {
/* no sliding: the new screen fades in where it stands */
.mo-b-scrn--detail { transform: none; opacity: 0; transition: opacity 200ms linear, visibility 0s 200ms; }
.mo-b-nav:has(.mo-b-open:checked) .mo-b-scrn--detail { opacity: 1; transition: opacity 200ms linear, visibility 0s; }
.mo-b-nav:has(.mo-b-open:checked) .mo-b-scrn--list { transform: none; }
}
Three details worth stealing:
- Each state carries the transition into it. The rule for "open" holds the 400 ms entering curve; the default rule holds the 200 ms leaving curve. That's how CSS gives you different timing in each direction.
visibilitywaits. The detail stays visible for the 200 ms it takes to leave, then becomes hidden, so it can't be reached by Tab or a screen reader while it's off screen.- Only
transformandopacityanimate. Browsers can move those without recalculating the layout, which keeps a full-screen slide smooth (web.dev, How to create high-performance CSS animations; Motion performance).
In a real site the screens are separate pages, and the browser can animate between them with View Transitions (Web Animations and View Transitions). The decisions are the same: direction, duration, curve, and what happens with reduced motion.
5. Reduced motion: fade, don't slide
A screen that slides across the whole viewport is the kind of large movement that can make people with vestibular disorders dizzy or sick. WCAG 2.3.3 asks that motion triggered by interaction can be turned off unless it's essential (W3C, Understanding 2.3.3). A slide isn't essential; the change of screen is. So under prefers-reduced-motion: reduce the figure replaces every slide with a 200 ms fade (MDN, prefers-reduced-motion). The map is still there: the Back link, the title, the same place for everything.
6. Common mistakes
- The same slide for every navigation, including tabs and dialogs.
- Transitions over 500 ms on something people do all day.
- Entering and leaving with the same curve and duration, so going back feels sluggish.
- A transition that blocks input: people should be able to tap Back while it's still moving (Apple HIG, Motion: "Let people cancel motion").
- Animating
leftorwidthinstead oftransform, and getting a stutter on cheaper phones.
7. Vocabulary
| Term | Meaning |
|---|---|
| Push | A new screen slides in over the old one, going deeper |
| Pop (back) | The reverse of a push |
| Shared axis | Both screens move together along x, y or z |
| Fade through | The old screen fades out, then the new one fades in |
| Decelerate (ease out) | Fast start, gentle stop: for things that arrive |
| Accelerate (ease in) | Gentle start, fast exit: for things that leave |
8. Try it (no tools needed)
- In an app you use daily, do five navigations: open an item, go back, switch tabs, open a menu, open a dialog.
- For each, write its direction and guess its duration: short, medium or long.
- Which ones would you change to a simple fade?
Reflection questions: Does going back in your product feel faster than going in? Which transition would you remove first if you had to remove one?
9. If you already practise
- Write a navigation motion table for your product: each relationship, its pattern, duration and curve in, duration and curve out, and its reduced-motion version.
- Put those values in Motion tokens so every team ships the same push.
- Test transitions on a cheap Android phone and with the system's reduced-motion setting on.
Checklist
Learn more
- Material Design 3, Transition patterns · Easing and duration tokens · Material Web motion tokens
- Material Components for Android, Motion
- Apple, Human Interface Guidelines: Motion
- W3C, Understanding 2.3.3 Animation from Interactions · web.dev, How to create high-performance CSS animations
Books, courses and videos to go deeper
- Learn CSS: Transitionsweb.devCourse · free, course module (external site)
- Designing Interface AnimationVal HeadBook · Rosenfeld Media, 2016 (Amazon)
Book links go to Amazon. As an Amazon Associate I earn from qualifying purchases, at no extra cost to you.
Related
The spatial model of an interface · Shared element transitions · Build a page transition · Easing curves · Navigation patterns