Showing Items in Slots in Inventory

Yo!

Im Trying to Create a inventory in which i will show the items picked up by the player. i have a basic idea of how im going to do the pickup but for displaying the data for that i need to know a simple thing and that how do i make it so that on every item pickup a new slot is created and the item is displayed in it. something like subnautica or any other game with inventory. and btw i dont want a item limit so that means i cant just place some slots already. if im not clear i can show a picture of what i want.

I think the main thing would be to use a reference to a container widget like a Horizontal Box, VerticalBox, Grid Pane or something, Then you Create Widget (an image, button, or custom widget class) and instead of adding to viewport or screen then use the container reference’s Add Child node.
After a widget is programmatically added to a container widget this way then sometimes you need to also programmatically set some of the Slot config values like Alignment and Fill/Auto, and Image Style or Button Style.