In the game, UI objects (buttons) are dynamically created, they can be added and removed, the parent object should adjust to their size and only grow to the right, i used anchor but it still increase in two sides
Video of adding objects and their propereties: