# BorderStroke

# BorderStroke

Artifact:[androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/BorderStroke.kt+class:androidx.compose.foundation.BorderStroke)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)
Common/AllAndroid/JVM
  - Cmn  

  ```
  class BorderStroke
  ```

*** ** * ** ***

Class to specify the stroke to draw border with.

## Summary

|                                                                                                                                                                                ### Public constructors                                                                                                                                                                                 |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [BorderStroke](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke#BorderStroke(androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Brush))`(width: `[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)`, brush: `[Brush](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush)`)` | Cmn |

|                                          ### Public functions                                           |
|---------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [BorderStroke](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke) | [copy](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke#copy(androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Brush))`(width: `[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)`, brush: `[Brush](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush)`)` | Cmn |
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)     | [equals](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                          | Cmn |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                      | [hashCode](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke#hashCode())`()`                                                                                                                                                                                                                                                     | Cmn |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                | [toString](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke#toString())`()`                                                                                                                                                                                                                                                     | Cmn |

|                                   ### Public properties                                    |
|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Brush](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush) | [brush](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke#brush()) brush to paint the border with                                                                          | Cmn |
| [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)           | [width](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke#width()) width of the border in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp). | Cmn |

## Public constructors

### BorderStroke

Cmn  
Added in[1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.9.0)  

```
BorderStroke(width: Dp, brush: Brush)
```  

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `width: `[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)           | width of the border in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp). Use[Dp.Hairline](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Hairline())for one-pixel border. |
| `brush: `[Brush](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush) | brush to paint the border with                                                                                                                                                                                                       |

## Public functions

### copy

Cmn  
Added in[1.10.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.10.0-rc01)  

```
fun copy(width: Dp = this.width, brush: Brush = this.brush): BorderStroke
```  

### equals

Cmn  

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

Cmn  

```
open fun hashCode(): Int
```  

### toString

Cmn  

```
open fun toString(): String
```

## Public properties

### brush

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)  

```
val brush: Brush
```

brush to paint the border with  

### width

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)  

```
val width: Dp
```

width of the border in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp). Use[Dp.Hairline](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Hairline())for one-pixel border.