It’s done by adding a “dashboard“ app to the phone. You’re not actually replacing a light switch with the phone. You are using the phone to support an app which then controls your smart switches.
For a recent discussion of some of these, see the following thread:
FAQ: Sharptools , actiontiles or native ST app for your wall panel? (2020)