All alkali metals and most alkaline earth metals react with cold water. The alkali metals are lithium, sodium, potassium, rubidium and cesium. The alkaline earth metals that react with water are magnesium, calcium, strontium and barium. Beryllium is also an alkaline earth metal, but it does not react with water.
Of these metals, magnesium has the weakest reaction to cold water. Magnesium hydroxide forms on the surface of the metal, and hydrogen bubbles are released into the water. This reaction is brief; it is weak enough that the magnesium hydroxide formed is an effective barrier between the water and the magnesium.
Calcium, strontium and barium react more strongly with water. All three form hydroxides and release hydrogen bubbles, but the hydroxides do not prevent further reactions. Calcium hydroxide precipitates into the water as a white powder, while the hydroxides of strontium and barium are water-soluble.
All the alkali metals react violently to water, and all except for lithium can start fires, as the released hydrogen burns in the open air. Each of these elements reacts with water to form a hydroxide, which generates heat. Only lithium does not produce enough heat to ignite the released hydrogen, eliminating the fire hazard.