Gradient only in x or y direction

Hello,

is it possible to make the gradient only in x or y direction in a 2D space? I would like to determine only the y value of the gradient on the x-axis.

I thought of ufl.grad but only in one direction. Does anyone have any ideas?

See : ufl package — Unified Form Language (UFL) 2021.1.0 documentation