Performance: Card groups and decks
MEDIUM IMPACT
This concept affects page load speed and rendering performance by how multiple card components are grouped and laid out, impacting layout calculations and paint times.
<div class="row row-cols-1 row-cols-md-3 g-4"> <div class="col"> <div class="card h-100">...</div> </div> <div class="col"> <div class="card h-100">...</div> </div> <div class="col"> <div class="card h-100">...</div> </div> </div>
<div class="card-group"> <div class="card">...</div> <div class="card">...</div> <div class="card">...</div> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Bootstrap card-group with variable content | Moderate DOM nodes | Multiple reflows due to height adjustments | Medium paint cost | [X] Bad |
| Bootstrap grid with h-100 cards | Moderate DOM nodes | Single reflow with fixed heights | Low paint cost | [OK] Good |
| Bootstrap card-deck (deprecated) | Moderate DOM nodes | Reflows on resize causing CLS | Medium paint cost | [X] Bad |
| Flex utilities with gap and flex-fill | Moderate DOM nodes | Minimal reflows, stable layout | Low paint cost | [OK] Good |