Permanent magnet ferrite blocks are commonly used for magnetic switch.
The sensor used in this type of switch is a reed switch that opens or closes an electronic circuit as a magentic field is nearby.
Both types are available; normally-open (NO) or normally-closed (NC) but both work in combination af a permanent magnet.
As the permanent magnet moves closer from the switch, it triggers it. When moving away, it releases it.
Though the principle seems simple, the choice of the permanent magnet is important.
It has to be as strong as possible while having limited dimensions and a low cost.
Common types for these applications are neodyme (NdFeB) blocks or, even cheaper, ferrite blocks.
We are able to supply both from our different manufacturing operations. Please contact us us for more details.