You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This provides the same cross-fade animation as using the `viewTransition` prop on Link components.
44
+
23
45
For more information on using the View Transitions API, please refer to the ["Smooth transitions with the View Transition API" guide][view-transitions-guide] from the Google Chrome team.
24
46
25
47
## Image Gallery Example
26
48
27
49
Let's build an image gallery that demonstrates how to trigger and use view transitions. We'll create a list of images that expand into a detail view with smooth animations.
28
50
29
-
### 2. Create the image gallery route
51
+
### 1. Create the image gallery route
30
52
31
53
```tsx filename=routes/image-gallery.tsx
32
54
import { NavLink } from"react-router";
@@ -62,7 +84,7 @@ export default function ImageGalleryRoute() {
62
84
}
63
85
```
64
86
65
-
### 3. Add transition styles
87
+
### 2. Add transition styles
66
88
67
89
Define view transition names and animations for elements that should transition smoothly between routes.
68
90
@@ -98,7 +120,7 @@ Define view transition names and animations for elements that should transition
98
120
}
99
121
```
100
122
101
-
### 4. Create the image detail route
123
+
### 3. Create the image detail route
102
124
103
125
The detail view needs to use the same view transition names to create a seamless animation.
104
126
@@ -122,7 +144,7 @@ export default function ImageDetailsRoute({
122
144
}
123
145
```
124
146
125
-
### 5. Add matching transition styles for the detail view
147
+
### 4. Add matching transition styles for the detail view
0 commit comments