Yes, you can do it componentwise. As you have three momenta, you have to write Hamilton's equations for all of them.
$\dot{x} = \partial H/\partial p_x$
$\dot{y} = \partial H/\partial p_y$
$\dot{z} = \partial H/\partial p_z$
Similarly for the momenta
$\dot{p_x} = \partial H/\partial x$
$\dot{p_y} = \partial H/\partial y$
$\dot{p_z} = \partial H/\partial z$