Atomic docs

imgui.PushID

imgui.PushID(id: string | number): ()

Makes identical labels distinct, which matters when widgets are built in a loop.

Example

lua
for i, name in ipairs(players) do
    imgui.PushID(i)
    if imgui.Button("target") then target = name end
    imgui.PopID()
end
↑