When metals react with water, metal hydroxides and hydrogen gas are formed.
For example, when potassium is added to water, the metal melts and floats. It moves around very quickly on the surface of the water. The metal self-ignites, which also ignites the hydrogen gas. This results in sparks and a lilac flame. There is sometimes a small explosion at the end of the reaction.
This can be represented in different ways as shown:
potassium + water → potassium hydroxide + hydrogen
2 K(s) + 2 H2O(l) → 2 KOH(aq) + H2(g)