How to make an paste to replace, but at the same time, so that the block sizes remain what they were

Hello! :wave:
I hope there’s a solution to my question.

I have created a button component with auto layout. I have designs imported from XD where buttons are represented as simple rectangles. These buttons have different sizes, including small, medium, and large. Is there a way for me to copy the component I created with one size and paste it with replacement, while keeping the original button dimensions?

For example: The button component I created is 200 by 50 pixels. And one of the buttons I want to replace is 150 by 50. Can I somehow copy the button component so that when it’s pasted, it has the dimensions of 150 by 50, without having to adjust everything manually?