--- title: TransitionGroup Performance with Large Lists and CSS Frameworks impact: MEDIUM impactDescription: TransitionGroup can cause noticeable DOM update lag when animating list changes, especially with CSS frameworks type: gotcha tags: [vue3, transition-group, animation, performance, list, css-framework] --- # TransitionGroup Performance with Large Lists and CSS Frameworks **Impact: MEDIUM** - Vue's `` can experience significant DOM update lag when animating list changes, particularly when: - Using CSS frameworks (Tailwind, Bootstrap, etc.) - Performing array operations like `slice()` that change multiple items - Working with larger lists Without TransitionGroup, DOM updates occur instantly. With it, there can be noticeable delay before the UI reflects changes. ## Task Checklist - [ ] For frequently updated lists, consider if transition animations are necessary - [ ] Use CSS `content-visibility: auto` for long lists to reduce render cost - [ ] Minimize CSS framework classes on list items during transitions - [ ] Consider virtual scrolling for very large animated lists - [ ] Profile with Vue DevTools to identify transition bottlenecks **Problematic Pattern:** ```vue ``` **Optimized Approach:** ```vue ``` ## Performance Optimization Strategies ### 1. Skip Animations for Bulk Operations ```vue ``` ### 2. Virtual Scrolling for Large Lists ```vue ``` ### 3. Reduce CSS Complexity During Transitions ```vue ``` ### 4. Use CSS content-visibility ```css /* For very long lists, defer rendering of off-screen items */ .list-item { content-visibility: auto; contain-intrinsic-size: 0 50px; /* Estimated height */ } ``` ## When to Avoid TransitionGroup Consider alternatives when: - List updates are frequent (real-time data) - List contains 100+ items - Items have complex CSS or nested components - Performance is critical (mobile, low-end devices) ```vue ``` ## Reference - [Vue.js TransitionGroup](https://vuejs.org/guide/built-ins/transition-group.html) - [GitHub Issue: transition-group DOM update lag](https://github.com/vuejs/vue/issues/5845) - [Vue Virtual Scroller](https://github.com/Akryum/vue-virtual-scroller)