How do alkali and alkaline earth metals react with water?

Alkali and alkaline earth metals react vigrously with water to form their respective hydroxide and hydrogen gas is evolved. However, the rate of reaction is somewhat slower for alkaline earth metals than the alkali metals.
2Na + 2 ${ H }{ 2 }O$ ---------> 2 NaOH +
${ H }
{ 2 }$
Mg + 2 ${ H }_{ 2 }O$ ----------->

Mg${ (OH) }{ 2 }$ +
${ H }
{ 2 }$