Use modals as Alerts

I want to have some funtionalities in my alert but its really difficult to do aal that so i was thinking can we use Modals as Alert by giving padding property or something to also show some background(i.e the previous page in the stack).

Can you give the code to make this happen?