Step 1: Picture the region.
The line $y=x$ together with $x=-1$, $x=2$, and the $X$-axis bounds a region. Area must be counted as positive everywhere, so we treat the part below the axis with a sign flip.
Step 2: Recognise two triangles.
Between $x=-1$ and $x=0$ the line lies below the axis forming a triangle; between $x=0$ and $x=2$ it lies above forming another triangle.
Step 3: Area of the left triangle.
Its base along the axis is $1$ (from $-1$ to $0$) and its height is $|y(-1)|=1$, so its area is $\dfrac{1}{2}\cdot 1 \cdot 1 = \dfrac{1}{2}$.
Step 4: Area of the right triangle.
Its base is $2$ (from $0$ to $2$) and its height is $y(2)=2$, so its area is $\dfrac{1}{2}\cdot 2 \cdot 2 = 2$.
Step 5: Add the pieces.
Total area $= \dfrac{1}{2} + 2 = \dfrac{5}{2}$ square units.
Step 6: Reflect.
Using the area-of-a-triangle formula sidesteps integration entirely while giving the same value as $\displaystyle\int|x|\,dx$.
\[ \boxed{\text{Area} = \dfrac{5}{2}\ \text{sq. units}} \]