Create images and texts in a box through code

Hello.
Is it possible to create images and texts in a box through code?Example:

let colors = ['green', 'red', 'blue'];

for (let i=0 ; i < colors.length; i++) {
 
 //create the image next to the text example below
  
  }
  

thanks

You should use a repeater for that.