Cursor spinner on handle event

I have a form with some buttons that trigger a handle event which calls external API and this process can last a few seconds. I would like for the cursor to be a spinner while handle event is executing to indicate waiting. Is there a way to do this?

See “Loading states and errors” Bindings — Phoenix LiveView v0.18.2 but likely you want to set some page element when the external API starts and stops and show the spinner by that instead. Probably have more control and easier to track. I guess if your remote API call is blocking in the form-submit action or whatever it doesn’t matter which way you go.

Also see JavaScript interoperability — Phoenix LiveView v0.18.2 phx-page-loading.