HTML & CSS · Senior · Question 33 of 75
What is the View Transitions API?
- 1An API for lazy-loading page fragments as you scroll
- ✓Correct answer: An API for animating transitions between DOM states or pages
- 3An API for smoothly switching between dark and light themes
Explanation
document.startViewTransition(() => updateDOM()) captures the old state, applies the changes and animates the transition via ::view-transition-old/new pseudo-elements, styled with regular CSS. MPAs get cross-document transitions via @view-transition. React 19.2 added a <ViewTransition> component.