How to stop an icon from shifting a toolbar as it loads
Answer in brief
Reserve the icon's space in the initial HTML. Give a square export matching width and height attributes, then use CSS to set its displayed size.
Measure before the download
For a 72-pixel square bell displayed at 24 pixels, set width="24" and height="24". Throttle the connection and reload with the cache disabled. The notification count beside the bell should occupy the same position before and after the image appears.
Inspect the first render with images blocked
Disable just the bell request and reload the toolbar. If the count moves into the bell's place, the dimensions may be applied only after a client component mounts. Put the size on the initial image or its always-present wrapper, then repeat with JavaScript disabled to isolate the server-rendered layout.
Sources
- [1] HTML Standard — WHATWG, accessed November 23, 2026
Frequently asked questions
What if the toolbar still jumps?
Inspect the count and its font separately. If the image box already has its final dimensions, another element may be changing width.