It depends on what you using. Are you using LiveView or is it just a plain view?
There isn’t much UI libraries for LiveView yet for what you are looking (if you are using LV that is), you would probably need to roll your own.
You would want to build something like this (MultiSelect | Mantine REACT). You would make use of a Hook to help you build it, although the JS module exists it isn’t enough on its own to accomplish more complex behavior of such component, in my opinion (I have built a multiselect component for a private app).