Best approach to use this type of 'sensor/switch'?

That last gif showing the switch tilting on and off reminds me very much like the old mercury tilt switches which were very popular at one time. I assume with all the effort to eliminate mercury from the environment has made this kind of switch more popular.

Lefty