Metal react with water and produce metal oxide and hydrogen as water is made of hydrogen and oxygen (oxide).
Equation- Metal + Water -> Metal Oxide + Hydrogen
Metal oxides that are easily dissolves in water they make metal hydroxide. But all metal do not react with water.
Equation- Metal Oxide + Water -> Metal hydroxide
Metals like Potassium and sodium react violently with cold water. The reaction of cold water with potassium and sodium is so strong and exothermic that the hydrogen produced through the reaction catches fire very easily, the second the produced hydrogen gas comes in the contact with air.
Where the reaction of calcium with water is not that violent. The heat evolved is not sufficient for the hydrogen gas produces during the reaction to catch the fire. Calcium starts floating because of the bubbles of hydrogen gas formed in water.
The Magnesium is one of the metal which does not react with water. It react with hot water which form magnesium hydroxide and hydrogen. It also start floating due to the hydrogen bubbles formed in water due to reaction.
Metals like aluminium, iron, zinc do not react with water at its any temperature. But they do react with steam and each of them form metal oxide and hydrogen after reaction.
Metals such as lead, copper, silver, gold do not react with any temperature or form of water at all.