Skip to main content
Question

Get auto layout component to snap into a container and fill the container, whatever size it is

  • January 30, 2023
  • 2 replies
  • 1171 views

Veronica_Sonzini

Hey! I’m building a design system, so I need my components to be reusable and responsive to fit in all views.
I’m trying to get a component (that has auto layout) to snap into a container, and automatically fill that container, so that I can make the component responsive to fit all views I need. For example a form field component that I want to add to a form for mobile and also to web. The containers for mobile and web are different size, so I need my form field component to fit to any of those containers when I’m drag and dropping the asset.
I’ve tried every possible auto layout convination and nothing works, is it possible to do this?

I couldn’t find this topic anywhere, sorry if it was already discussed.

This topic has been closed for replies.

2 replies

tank666
  • 4873 replies
  • January 30, 2023

Could you tell more about this component: what kind of component it is, how it should work, etc. Also could you show examples of what you want to achieve?


  • 1 reply
  • March 5, 2024

The idea if I understand correctly is the following. I want to make a component with a variant which is always 100% of the parents width. So whenever I hit “insert component”
the component should have the width and height set to fill container.
Right now the height and width is set to the height and width of the parent component. When I look at the component the variant has width and height correctly set to fill container. But on inserting it, it looses that property and takes on a fixed height and width

See these two links fore reference

https://www.reddit.com/r/FigmaDesign/comments/ti2n4p/is_it_possible_to_have_a_component_set_to_fill/


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings