---
title: "Stroke"
description: "[DrawStyle] that provides information for drawing content with a stroke"
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
class Stroke(
    val width: Float = 0.0f,
    val miter: Float = DefaultMiter,
    val cap: StrokeCap = DefaultCap,
    val join: StrokeJoin = DefaultJoin,
    val pathEffect: PathEffect? = null,
) : DrawStyle()
```


`DrawStyle` that provides information for drawing content with a stroke

#### Parameters

| | |
| --- | --- |
| width | Configure the width of the stroke in pixels |
| miter | Set the stroke miter value. This is used to control the behavior of miter joins when the joins angle is sharp. This value must be >= 0 |
| cap | Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated. The default is `StrokeCap.Butt` |
| join | Set's the treatment where lines and curve segments join on a stroked path. The default is `StrokeJoin.Miter` |
| pathEffect | Effect to apply to the stroke, null indicates a solid stroke line is to be drawn |



## Companion Object

#### Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
const val HairlineWidth = 0.0f
```


Width to indicate a hairline stroke of 1 pixel



<div class='sourceset sourceset-common'>Common</div>


```kotlin
const val DefaultMiter: Float
```


Default miter length used in combination with joins



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val DefaultCap = StrokeCap.Butt
```


Default cap used for line endings



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val DefaultJoin = StrokeJoin.Miter
```


Default join style used for connections between line and curve segments





