Using Raycast inside UI Widgets

I’m doing a radial menu, and I was wondering if it was possible to use a Raycast that goes from the center of the viewport to the player’s mouse, detect if the Raycast hits a button, and act as a Hover?

If not, is there another way I can do something similar?