show spinner while loading component

Hello

here is my scenario:
when i click in a button there is some server side treatment that need to be done (conversion of images that can takes few seconds)
before i show the new page,
what i want is to show a spinner while the conversion process

anyone know how to do it ??
is there any component that can easily do it ?