“A tree view (collapsible list) can be created using only HTML and CSS, without the need for JavaScript.”
Nested lists, details and summary elements, and some pseudo-elements for the connecting lines. The browser does the expanding and collapsing for free, and keyboard focus works. Half the npm packages for tree views ship more JavaScript than this whole page. HTML grew up while everyone was busy importing frameworks.