Gradient controls

A gradient is normally something you configure in code and then leave alone. The createLinearGradientControls() helper from fabric/extensions turns it into something you can drag directly on the canvas.

Select the rectangle and try the handles:

The object’s own corner handles still work, and the gradient handles follow along when you move, scale or rotate it.

For the gradient object itself — linear versus radial, coordinates and units — see the using gradients guide.

Edit this page on Github