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

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.

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?