When you first click and prior to page user is sent to starts to load (ie: page is loaded workflow) there is likely an event the user is navigating away from to show a loading screen, something much easier to achieve with smooth ui when done on single page apps, since user is not leaving and then loading pages, but instead hiding/showing containers.
You can hide/ show in various ways, but my preference is through URL data in conditionals.
Either way, you can think that first action in the series after the trigger of button click would be to show a loader, then depending on app structure, navigate to new page, which also needs to show a loader with trigger of page is loaded, or if single page app the next step after showing loader would be to hide container and show new container then hide loader.