Skip to content

Commit 6e0af1f

Browse files
authored
feat: view transitions (#141)
1 parent 234e7b1 commit 6e0af1f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

guide/animations.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,31 @@ This will give you a nice sliding effects on slide switching. Setting it in the
247247
- `slide-right` - Slides to the right (slide to left when going backward)
248248
- `slide-up` - Slides to the top (slide to bottom when going backward)
249249
- `slide-down` - Slides to the bottom (slide to top when going backward)
250+
- `view-transition` - Slides with the view transitions API
251+
252+
### View Transitions
253+
254+
> Available since v0.43.0
255+
256+
The **View Transitions API** provides a mechanism for easily creating animated transitions between different DOM states. Learn more how it works in [View Transitions API - MDN Web Docs - Mozilla](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API).
257+
258+
:::warning
259+
Experimental: This is not supported by all browsers. Check the [Browser compatibility table](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility) carefully before using this.
260+
:::
261+
262+
You can use the `view-transition-name` CSS property to name view transitions, which creates connections between different page elements and smooth transitions when switching slides.
263+
264+
You can enable [MDC (Markdown Component) Syntax](https://content.nuxtjs.org/guide/writing/mdc) support to conveniently name view-transitions:
265+
266+
```md
267+
---
268+
transition: view-transition
269+
mdc: true
270+
---
271+
# View Transition {.inline-block.view-transition-title}
272+
---
273+
# View Transition {.inline-block.view-transition-title}
274+
```
250275

251276
### Custom Transitions
252277

0 commit comments

Comments
 (0)