Toggle switch on digital circuits?

You found one rated for 36VDC, which is its maximum voltage, so it's fine for 5VDC.