Over the past few months, I have been paying close attention to something that almost always goes unnoticed, even by experienced professionals: optical alignment.
In theory, aligning two things is simple. You place one next to the other, set the same paddings, the same distance, the same size, and it is done. But anyone who works with interfaces knows that it is not that straightforward. Sometimes everything is mathematically perfect, and it still looks wrong.
Why does this happen?
Because our eyes do not follow mathematics. They follow perception.
Optical alignment is exactly that. It means adjusting elements not based on exact numeric values but based on what looks right. And this applies to everything. Components, inputs, icons, typography, cards, any element that depends on visual balance.
If you have read materials like Jakub’s article Logical vs Optical
Here is where things get interesting. In many cases, if you align everything strictly by the numbers, the final result will look pulled to one side.
Caption: comparison between mathematical alignment on the left and optical adjustment on the right. Notice how the padding values may be identical in the inspector, yet the visual adjustment made by eye creates a more balanced composition.
In practice, I aligned the text mathematically with the box in one example, and in the other, I made an optical adjustment. I intentionally left slightly different values, even if Figma or the inspector reports the same numbers. The result is visible. The second example looks more centered and harmonious.
A practical tip for developers: reducing the extra space above and below the text inside the box helps a lot. It makes the vertical space of the text more predictable and makes small optical corrections easier and more consistent. It does not replace a critical eye, but it reduces unexpected variations and gives you a more stable base to listen to what the visual balance demands.
If you take design and UI development seriously, understanding this is extremely worthwhile. Not to become another perfectionist obsessed with tiny three-pixel differences, but to build interfaces that truly look well balanced, intentional, and professional.
Mathematics is the starting point.
But the finishing touch, the part that truly separates an ordinary layout from a good one, comes from the eye.
And with optical alignment, the eye always has the final word.