Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/transition-over-js-library.md
1---2title: View Transitions Over JS Libraries3impact: MEDIUM4tags: view-transition, native, performance5---67## View Transitions Over JS Libraries89Prefer View Transitions API over JavaScript animation libraries for page transitions.1011**Incorrect (JS-based transition):**1213```tsx14import { motion } from "motion/react";1516function ImageLightbox() {17return (18<motion.img layoutId="hero" />19);20}21```2223**Correct (native View Transition):**2425```ts26function openLightbox(img: HTMLImageElement) {27img.style.viewTransitionName = "hero";28document.startViewTransition(() => {29// Native browser transition30});31}32```33