question: material preview on UI

hi,

im trying to make a material preview, like the well-known sphere on material browser, on a floater.
its a workaround on architectural material management.
couldnt get how to do it. does anyone tried it yet?