Live username availability checking on the registration page is the common feature in most of the website.
This will notify the user whether the username is already been taken or not before submitting.
To do this require AJAX.
Send a request to check the username on the bases of response perform the action.
In this tutorial, I show how you can check username availability using Vue.js and PHP.