Screen Transition
Direction-aware animated screen switcher for shell-based navigation. Supports Tab (fade), Push (slide right), and Pop (slide left) — the three primitives of mobile-style navigation.
Interactive demo
A shell with 3 tabs and a push/pop flow. Tab-switching fades; tapping Settings pushes a detail screen; the back button pops back.
Good morning 👋
Welcome to the Home tab.
Direction reference
Each direction maps to a real navigation gesture — use them semantically for the best UX.
Switching between sibling tabs. The tab bar stays static; only the content area fades.
Drilling into a detail screen. Mirrors iOS/Android push navigation.
Returning to a parent screen. Pair with a back button to complete the gesture.
Usage in a shell component
Set Direction before changing Key — both happen in the same render cycle so no extra StateHasChanged is needed.
Auto-detecting direction from URL depth
When sub-components trigger navigation directly via NavigationManager, detect direction in OnLocationChanged by comparing URL segment depth.
_backTarget
string (set on Push) so GoBack always navigates to the right screen.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
Key | object? | — | Change this to trigger the transition (enum, string, or int) |
Direction | ScreenTransitionDirection | None | Tab, Push, Pop, or None (no animation) |
Duration | double | 0.28 | Animation duration in seconds |
SlideDistance | double | 40 | Slide distance in pixels for Push/Pop |
Class | string? | — | CSS classes applied to the wrapper element |