I want to adjust the width of a button while keeping the icon, and text centered within the button. This works when it is not a component it seems, but when I make it into a component it does not work (Refer to image).
Does Figma not support this functionality yet with icons?
@PFEIFFER_Amanda_CNH_Industrial To keep the icon+text centered and then later truncated, there isn’t an automatic way I found with auto layout that works, because you would need to have the text dynamically change between a hug and fill (center and truncate).
So a workaround I’ve used is to create a button component built using auto layout with 2 variants:
One has the text set to hug, which keeps the text centered
The other has the text to fill, which will truncate the text when the button scales down.
I then can toggle between those 2 settings as needed as I adjust the button instance’s width.
That all said maybe there is another way I haven’t found yet using min-max width, layout grids, etc.