Responsive component with AutoLayout?

Set the children inside a frame with Auto Layout to stretch left and right (when vertical) or top and bottom (when horizontal).

Credit @Figma