---
title: "stroke(_:lineWidth:antialiased:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/shapeview/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.Content, S, Self> 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

### Modify the shape

- [fill(_:style:)](swiftui/shapeview/fill(_:style:).md)
- [stroke(_:style:antialiased:)](swiftui/shapeview/stroke(_:style:antialiased:).md)
- [strokeBorder(_:style:antialiased:)](swiftui/shapeview/strokeborder(_:style:antialiased:).md)
- [strokeBorder(_:lineWidth:antialiased:)](swiftui/shapeview/strokeborder(_:linewidth:antialiased:).md)
