Vector icons do not line up with text out of the box. Unlike letters, graphic paths lack a consistent baseline, ascender, or descender. If you place an icon next to a text label using browser defaults, the shape floats above or below the text baseline.
We use GeoIcons components for the examples in this post. The library includes clean, optimized map outlines for all countries and regions. Because each shape is a real geographic outline rather than a uniform square glyph, the same alignment rules you would use for any icon apply directly, and each component exposes size and className props to make them easy to apply.
You can fix this visual gap with Tailwind CSS flexbox utilities and relative sizing.
Key takeaways
Flexbox alignment anchors the visual centers of icons and text.
Sizing utilities map the SVG bounds to the text line-height.
Translation utilities correct visual offset in asymmetric country shapes.
Anchor the visual centers
Use flexbox to align the icon c
Discussion
Start the conversation
Your voice can be the first to spark an engaging conversation.