Components that have dynamic logic

I’m looking for a way to dynamically (automatically) adjust component top/bottom padding based on what new component has been added to the top or bottom of that component. So for example, if I stack two different components together, create an autolayout, adjust the padding between them to be 0px since I’d be creating a webpage - I want the bottom padding of the top component to dynamically adjust AND the top padding in the bottom component to automatically update once the 0px in between autolayout is set. Any way to do this Figma? Any plugins that can help?