Magento 2 create collapsible refinementlist

Hi all,

I am new to Algolia and I’ve been customizing it to fit our Magento 2 store but I’ve run into an issue that it giving me a hard time. I want the refinement list widget in our instantsearch page to be collapsible because we have quite a few attributes the user can filter with and the way it is presented now there is a lot of scrolling required.

I know that the collapsible attribute is no longer available and that I have to implement this using panels but so far I haven’t managed to do this properly. Would anyone have an example of how to go through the refinementlist widget and add a panel to each attribute?

Thanks,
Michael

ps. apologies if I am offtopic