How to append UI elements?

Let’s say I want to display a list of servers (just simple buttons with text on them) that get a specific Yoffset position e.g. i*30. I know I should just use a simple for loop but how do I actually append/display the buttons with a blueprint script? Do I create widgets over and over again with just a button in it?

Thanks for reading!

if you are using UMG, you can have an empty vertical box and use an addChild node to add a widget or button.

if you are drawing with the HUD canvas, you can use a loop, multiplying the index by the distanceBetweenButtons, and use that to set the screenY coordinate of each DrawTexture and DrawText node. you can also use AddHitBox to detect mouse input.