(Editor Scripting) Is There A Way To Mimic The "Add Component" Menu??

Hi, is there a way to make a dropdown menu that contains a list of components
like the “Add Component” menu?
107937-addcomponent.png

Happy holidays!

You can find the decompiled Editor source on github and try to find how They did it.