a small spring will push the magnet away so the ball/ iron is released and only attracted when pressed.
Magnet is 25mm × 5mm∅