You can look into the docs of shadcn. There is a component named combo box which serves your purpose. You can check out here. I will also implement it after sometime so I will share my code here after that.