My response above contains a link to the Tree documentation. Though, for a visual reference, that’s the control that’s used in the Godot editor for the Scene Tree and the FileSystem panel.
It provides the expand / collapse feature that you mention, though depending on your requirements, it may not be what you need…
I copy the example code and it doesn’t work, as it would with a label
I have a post in it that says to use a control node for volume so nothing overlaps, and the top level container for inputs/input_containers to hide/show the content.
look at the forum thread link to see more info, but it goes something like this:
-control_node
-toggle button
-top_level container
—inputs/other input containers
signal to control_node from toggle button:
if toggled:
control_node = toggle_button.custom_minimum_size.y
top_level_container.hide()
else:
control_node = toggle_button.custom_minimum_size.y + top_level_container.custom_minimum_size.y
top_level_container.show()