Create Multiple Select dropdown / Reuse Categories Component

Hey, im working on a custom module. The Module generator works great. But I need a Multiple Select dropdown. I have no Idea how to reuse the Dolibarr component for this. To code somethin new would be easy but I dont think that this would be the “Dolibarr way”

I’ve seen a a Multiple Select in Products → Categories (using the module categories)

TLDR;
How can I reuse the categories component in a custom module?

@Felix_Ruby

multiselectarray() is what you are looking for.

https://doxygen.dolibarr.org/13.0/df/d08/class_form.html#a74981801afca44852e915b99d1cde763