---
title: "stroke(_:lineWidth:antialiased:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/shape/stroke(_:linewidth:antialiased:)"
---

# stroke(_:lineWidth:antialiased:)

Traces the outline of this shape with a color or gradient.

## Declaration

```swift
nonisolated func stroke<S>(_ content: S, lineWidth: CGFloat = 1, antialiased: Bool = true) -> StrokeShapeView<Self, S, EmptyView> where S : ShapeStyle
```

## Parameters

- `content`: The color or gradient with which to stroke this shape.
- `lineWidth`: The width of the stroke that outlines this shape.

## Return Value

Return Value A stroked shape.

## Discussion

Discussion The following example draws a circle with a purple stroke: Circle().stroke(Color.purple, lineWidth: 5)

## See Also

### Setting the stroke characteristics

- [stroke(_:lineWidth:)](swiftui/shape/stroke(_:linewidth:).md)
- [stroke(lineWidth:)](swiftui/shape/stroke(linewidth:).md)
- [stroke(_:style:)](swiftui/shape/stroke(_:style:).md)
- [stroke(_:style:antialiased:)](swiftui/shape/stroke(_:style:antialiased:).md)
- [stroke(style:)](swiftui/shape/stroke(style:).md)
