The official ProseMirror menu example says
If you already have some kind of dataflow abstraction that you're routing ProseMirror updates though, writing the menu as a separate component and connecting it to the editor state should work well.
In this example, the menu is written in hyperapp, and then binded to ProseMirror.