You can extract the stroke from a shape to create a new shape.
You can fill the extracted stroke with a gradient, image, or pattern.
Click a shape to select it.
Go to the Object menu and choose Extract Stroke.
The stroke will become a new shape. The new shape will be selected.
You can now click and drag the new shape, resize it, rotate it, or change the fill properties of the shape.