u/Meaksen

Specific padding in button with/without icons

Specific padding in button with/without icons

I'm creating a button component for the company I work for, and I can't figure out an intuitive way to handle the padding when adding an optional icon.

The button should support:

  • Text only
  • Icon + text
  • Text + icon

The problem is that I want the horizontal padding to behave correctly depending on whether the icon is on the left or right.

For example, in the image:

  • Text-only button: 20px horizontal padding
  • Icon + text: 18px on the icon side and 20px on the text side
  • Text + icon: 20px on the text side and 18px on the icon side

Is there a good way to set this up in Figma so that designers can simply choose "Icon: Left/Right/None" without having to manually adjust padding?

I'd love to know how you would structure the component/variants for this.

https://preview.redd.it/i0doub4isakh1.png?width=397&format=png&auto=webp&s=d042411a8e7b7b1d371ea21b1dc68722b7ccf50d

reddit.com
u/Meaksen — 1 day ago