Slot component - strange behaviour

I’m currently having trouble using slot components, honestly don’t know if it’s a bug or if I’m doing anything wrong.

I followed these steps:

  1. Create slot component and insert it in another component (ex. card), making sure slot height is set “hug content” and width is set “fill container”, and insert an instance swap property to the slot.

  2. Publish component and use it in another file. Swapped slot to button: button has “hug content” in height and width as well, I set it to “fill container” to the width

  3. I make an edit to the main component (ie. change text color) and publish

  4. When i go the other file and hit update this is the result, button takes slot height and goes back to hug for width

Why is this happening? Thanks for your help

Slots don’t exist in Figma natively — only as a complex and potentially buggy workaround. So it’s hard to say what could be wrong and if this can be fixed without seeing your specific implantation of slots.

What is that workaround? Does it solve the bug where the swapped component still takes the size of the original slot?

See: Instances not resizing with variable swaps - #2 by Gleb