Skip to main content
Answer

Auto-layout component with tooltip

  • June 2, 2021
  • 5 replies
  • 2257 views

alexf

I’m trying to create a button with a tooltip on hover:
figma6

The only problem is, as the text is different for each button, so is the size and I can’t use auto-layout as the tooltip will now be included in the frame and so the hover will break:
figma5

If I put the button with different text into an auto-layout next to another button, I get this:
image

Basically, is there a way to resize the component frame without breaking the hover?

Best answer by tank666

Hi @alexf. You can put a tooltip in a zero-height frame, and this frame in Auto Layout. I just updated the community file where I added a tooltip for the buttons. Duplicate and see how it works.

Figma
This topic has been closed for replies.

5 replies

tank666
  • Answer
  • June 10, 2021

Hi @alexf. You can put a tooltip in a zero-height frame, and this frame in Auto Layout. I just updated the community file where I added a tooltip for the buttons. Duplicate and see how it works.

Figma

alexf
  • Author
  • New Participant
  • June 10, 2021

That’s awesome. Thanks for that! 😃


alexf
  • Author
  • New Participant
  • June 10, 2021

Hey @tank666, curious how you managed to make the frame zero-height? I can only get mine to go to 1px.


tank666
  • June 10, 2021

Just write in the input .001.


Gabriel_R
  • New Participant
  • September 4, 2024

It’s been a while, so this is now solved properly with the “Absolute position” option.