<div class='type'>Compose Modifier</div>

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


<h2 id="border-border-shape">border</h2>

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


```kotlin
fun Modifier.border(border: BorderStroke, shape: Shape = RectangleShape) =
    border(width = border.width, brush = border.brush, shape = shape)
```


Modify element to add border with appearance specified with a `border` and a `shape` and clip it.

#### Parameters

| | |
| --- | --- |
| border | `BorderStroke` class that specifies border appearance, such as size and color |
| shape | shape of the border |






<hr class="docs-overload-divider">


<h2 id="border-width-color-shape">border</h2>

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


```kotlin
fun Modifier.border(width: Dp, color: Color, shape: Shape = RectangleShape) =
    border(width, SolidColor(color), shape)
```


Modify element to add border with appearance specified with a `width`, a `color` and a `shape`
and clip it.

#### Parameters

| | |
| --- | --- |
| width | width of the border. Use `Dp.Hairline` for a hairline border. |
| color | color to paint the border with |
| shape | shape of the border |






<hr class="docs-overload-divider">


<h2 id="border-width-brush-shape">border</h2>

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


```kotlin
fun Modifier.border(width: Dp, brush: Brush, shape: Shape) =
    this then BorderModifierNodeElement(width, brush, shape)
```


Modify element to add border with appearance specified with a `width`, a `brush` and a `shape`
and clip it.

#### Parameters

| | |
| --- | --- |
| width | width of the border. Use `Dp.Hairline` for a hairline border. |
| brush | brush to paint the border with |
| shape | shape of the border |