How do I make a rectangle using code in MIT app inventor?

I want to make code where when I press a button, it makes a rectangle. Pls show me how to do this, I am trying a lot.

using code blocks

On a canvas ?

(draggable blocks)

image

Or you could use two vertical arrangements, one inside the other....setting the inner one slightly smaller than the outer, with different colour backgrounds.

image