It's an image from my textbook where it's written that EPG is scalar but at some sites I read that it is vector.
1 Answer
The key here is that the text states "along a particular direction". The electric potential gradient, is in general, a vector quantity, but when on the component is a specific direction is considered it is a scalar. More mathematically what is being suggested here is that the quantity of interest is the projection of the potential gradient in specific direction and that is indeed a scalar.
Let $V$ be the electric potential, then the gradient, a vector, is the negative of the electric field: $-\vec{E} = \nabla V$.
The text's example is equivalent to $\hat{r}\cdot\nabla V$, where $\hat{r}$ is a unit vector in the specific direction and the result of the dot product of two vectors is a scalar.