Question: How to resize shape widgets through code?

Hey!

I’m designing an interactive segment in my portfolio where I want to manually change certain widgets sizes through my code (like for example i want to change a shape widget from square to rectangle). Does anyone know how to achieve this? Or at least guide me in the direction to do so please?