Question about an inventory system idea

So I have a basic.idea of how I can do an inventory but I dont know a thing really important.
When I enter in the object’s collider it is destroyed and added in the inventory by just saying inventory.Add but I dont know how in the inventory I can add this item graphically to the first slot.
I know.I can set.the item icon would be the same as the item’s but how can I set the first slot? And if the first.slot isn’t empty the second?

you loop in every slot possible, and check if they are empty. If they are, you place the item there and stop the loop. If none are, just drop the item. Just do a mono behaviour on every slot that contain the item and make it render.

This is an example to what Fire_Cube said:

bool AddItem(int item)
{
    foreach (var slot in inventory.slots)
    {
        if (slot != -1)
        {
            slot = item;
            return true;
        }
    }
    return false;
}

This function will return true if the item was successfully asigned to a slot, or false if there isn’t enough space, in which case you may drop the item or whatever.

Also, this is assuming that your items are stored as integers, and that an empty slot is represented as -1.