Skip to main content
Question

Slot component - strange behaviour

  • July 10, 2023
  • 3 replies
  • 865 views

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

This topic has been closed for replies.

3 replies

Gleb
  • Power Member
  • July 10, 2023

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.


Stan5
  • New Participant
  • April 11, 2024

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


Gleb
  • Power Member
  • April 11, 2024

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