Performance: Why icon integration matters
Icon integration affects page load speed and rendering performance by influencing asset size and DOM complexity.
<svg class="icon" aria-hidden="true" focusable="false"> <use href="bootstrap-icons.svg#alarm" /> </svg> <svg class="icon" aria-hidden="true" focusable="false"> <use href="bootstrap-icons.svg#battery" /> </svg>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css"> <i class="bi bi-alarm"></i> <i class="bi bi-battery"></i> <i class="bi bi-calendar"></i>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full Bootstrap Icons CSS + font | Low (few DOM nodes) | 1 reflow on font load | High paint cost for font glyphs | [!] OK |
| SVG sprite with <use> | Moderate (SVG elements added) | Single reflow | Low paint cost, GPU accelerated | [OK] Good |
<i class="bi bi-alarm"></i> Alarm
<i class="bi alarm"></i> Alert
Pass the test and this pattern moves unknown