There's something bugging me about icons.
Take a look at these two components, what's wrong? 10 points are on offer.
That's right! There are two problems:
-
The left padding is optically too large
-
The gap is too loose
When composing components like this (with an icon), the process is:
-
Nest an icon
-
Set preferred instances
-
Bubble up the icon to the top level for instance swapping
This is because of...bounding boxes.
They make sense because "consistency", but in practice introduce complications to consistent systems-oriented design.
What can be a perfectly set up grid of 24x24 icons in your system can create problems for pixel perfection in designs.
We're then forced to create specific space overrides for when bounding boxes are too large. This is optical design running its course, but as a systems person you scratch your head because of the magic numbers requirement for "Left padding 8, right 16", as an example.
What is useful is height. There's an argument to suggest a height-based bounding box could create consistent touch point size (for accessibility).
The likelihood for horizontal sizing is that your icon will always be nested, for example in an icon button with a width anyway.
This could mean that icons are sized with their inherent width in the system, versus a consistent X rule It would remove the need for pixel overrides, and mean that icons should "just work" when placed as instances It feels like scalability.
Other things to think about
Inheritance tax
When setting fixed sizes at the icon level (within the system) we're kind of making future decisions without the context.
Should the icon button be the place we decide on the icon's size, versus inheriting a choice?
What if we need a fixed size?
Taking a common example, an icon button. The likelihood is that your component is set to a fixed (or minimum) size in order to meet tap target sizes for accessibility.
This is a specific instance where we need the icon at a perceived fixed size too. But is that true? Is the size not defined by the wrapping button element?
To protect optical sizing, we can manage this by wrapping the icon in a div (in HTML) or frame (in Figma) to manually set its vertical or horizontal position.
This would be the same if we were looking at something like an icon list, as demonstrated in the above asset.
--
This article will likely be ongoing.
Thanks!