Using navigation macro for other dropdowns in typhoon

I’ve starting using Typhoon with Tailwind.css and Alpine.js and am enjoying it. When installing and styling the langswitcher plugin it struck me that it should be possible to use the navigation macro to manage the dropdown, but I’m stuck on creating the array to pass in to the macro.

Am I correct in assuming the best way would be do it in PHP with a structure similar to the buildLinkNode function?
Or could I make an array in twig to pass to macro?