in spherical coordinates:
\vec{r}=r\hat{e_r}
understand r=f(r) and \hat{e_r}=f(\theta , \phi )
it is well understood in multivariable calculus that, given z=f(x,y) we have dz=\frac{\partial z}{\partial x}dx+\frac{\partial z}{\partial y}dy (this is intuitive as well).
now by the product rule we have d\vec{r}=dr\hat{e_r}+r d\hat{e_r}
thus it seems we have only to compute d \hat{e_r}. by the above theorem, d \hat{e_r}=\frac{\partial \hat{e_r}}{\partial \theta}d\theta+\frac{\partial \hat{e_r}}{\partial \phi}d\phi. a geometric illustration works best from here, but ill outline the procedure.
by definition of a partial derivative, we have \frac{\partial \hat{e_r}}{\partial \theta}=\lim_{\Delta \theta \to 0} \frac{\hat{e_r}(\theta +\Delta \theta, \phi)-\hat{e_r}(\theta , \phi)}{\Delta \theta}. recognize (by drawing a picture perhaps) that \hat{e_r}(\theta +\Delta \theta, \phi)-\hat{e_r}(\theta , \phi)= \sin(\phi) \hat{e_\theta}\Delta \theta. after considering the limit we arrive at simply d \hat{e_r}=\sin(\phi) \hat{e_\theta}d\theta+\frac{\partial \hat{e_r}}{\partial \phi}d\phi
the \phi term is conducted in a similar fashion. if you're lost in the geometry, sketch it out (it makes much more sense that way). hope this helps!