I am trying to recreate Godot's Editor Inspector settings which I still could not figure out how it was done.
At the moment, what I am working on looks like the following

The one on the left, is my current settings configuration menu, but I would really like to get it similar to how Godot handles the property list of each object nodes in the Inspector tab (example screenshot below)

I've went through the source code inside editor_node.cpp and inspector_dock.cpp, but I can't seem to find how Godot essentially handles drawing the inspector editor for each object at runtime.
All I need is technically to find a way on how I could potentially add a VBoxContainer underneath the TreeItem so that if I were to collapse the Tree, my panel gets collapsed as well with gdscript.