# BorderScope

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/style/StyleScope.kt+class:androidx.compose.foundation.style.BorderScope) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.12.0) Common/All
- Cmn

  ```
  @ExperimentalFoundationStyleApi
  interface BorderScope
  ```
Known direct subclasses [DrawStyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/DrawStyleScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/DrawStyleScope` | An interface that introduces the drawing property to a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` receiver scope. |

Known indirect subclasses [StyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` | A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` is the receiver scope of a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` lambda. |

*** ** * ** ***

An interface that introduces border properties to a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` receiver scope interface.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` |   |

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderBrush(androidx.compose.ui.graphics.Brush)(value: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush)` Sets the brush used to paint the border around the component. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderColor(androidx.compose.ui.graphics.Color)(value: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)` Sets the color of the border around the component. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderWidth(androidx.compose.ui.unit.Dp)(value: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)` Sets the width of the border around the component. | Cmn |

| ### Extension functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#(androidx.compose.foundation.style.BorderScope).border(androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Brush)(width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush)` Sets a border for the component with the specified width and brush. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#(androidx.compose.foundation.style.BorderScope).border(androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color)(width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)` Sets a solid border for the component with the specified width and color. | Cmn |

## Public functions

### borderBrush

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

```
fun borderBrush(value: Brush): Unit
```

Sets the brush used to paint the border around the component. The border is drawn on top of the background and the padded content. This method only sets the brush; width must be set separately. The border's presence and appearance do not affect the component's layout size.

This property is *not* inherited

| Parameters |
|---|---|
| `value: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush` | The brush to paint the border (e.g., for gradients). |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderWidth(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderColor(androidx.compose.ui.graphics.Color)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.BorderScope).border(androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color)` | (Dp, Brush) |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/border.modifier#(androidx.compose.ui.Modifier).border(androidx.compose.foundation.BorderStroke,androidx.compose.ui.graphics.Shape)` |   |

### borderColor

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

```
fun borderColor(value: Color): Unit
```

Sets the color of the border around the component. The border is drawn on top of the background and the padded content. This method only sets the color; width must be set separately. The border's presence and appearance do not affect the component's layout size.

This property is *not* inherited

| Parameters |
|---|---|
| `value: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | The color of the border. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderWidth(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderBrush(androidx.compose.ui.graphics.Brush)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ShapeScope#shape(androidx.compose.ui.graphics.Shape)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/border.modifier#(androidx.compose.ui.Modifier).border(androidx.compose.foundation.BorderStroke,androidx.compose.ui.graphics.Shape)` |   |

### borderWidth

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

```
fun borderWidth(value: Dp): Unit
```

Sets the width of the border around the component. The border is drawn on top of the background and the padded content. The border's width does not contribute to the component's layout size (width/height); it is rendered within the component's bounds This method only sets the width; color or brush must be set separately.

Specifying a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Unspecified()` value will remove the border.

Specifying a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Hairline()` or 0.dp value will create 1 pixel border regardless of density.

This property is *not* inherited

| Parameters |
|---|---|
| `value: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The width of the border. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderColor(androidx.compose.ui.graphics.Color)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderBrush(androidx.compose.ui.graphics.Brush)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.BorderScope).border(androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ShapeScope#shape(androidx.compose.ui.graphics.Shape)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/border.modifier#(androidx.compose.ui.Modifier).border(androidx.compose.foundation.BorderStroke,androidx.compose.ui.graphics.Shape)` |   |

## Extension functions

### BorderScope.border

Cmn 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/style/StyleScope.kt+function:border)

```
@ExperimentalFoundationStyleApi
fun BorderScope.border(width: Dp, brush: Brush): Unit
```

Sets a border for the component with the specified width and brush. The border is drawn on top of the background and the padded content. The border itself does not contribute to the component's layout size (width/height).

Specifying a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Unspecified()` width will remove the border.

Specifying a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Hairline()` or 0.dp width will create 1 pixel border regardless of density.

This property is *not* inherited

| Parameters |
|---|---|
| `width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The width of the border. |
| `brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush` | The brush to paint the border (e.g., for gradients). |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderWidth(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderColor(androidx.compose.ui.graphics.Color)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderBrush(androidx.compose.ui.graphics.Brush)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/border.modifier#(androidx.compose.ui.Modifier).border(androidx.compose.foundation.BorderStroke,androidx.compose.ui.graphics.Shape)` |   |

### BorderScope.border

Cmn 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/style/StyleScope.kt+function:border)

```
@ExperimentalFoundationStyleApi
fun BorderScope.border(width: Dp, color: Color): Unit
```

Sets a solid border for the component with the specified width and color. The border is drawn on top of the background and the padded content. The border itself does not contribute to the component's layout size (width/height).

Specifying a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Unspecified()` width will remove the border.

Specifying a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp#Hairline()` or 0.dp width will create 1 pixel border regardless of density.

This property is *not* inherited

| Parameters |
|---|---|
| `width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The width of the border. |
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | The color of the border. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderWidth(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderColor(androidx.compose.ui.graphics.Color)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/BorderScope#borderBrush(androidx.compose.ui.graphics.Brush)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/border.modifier#(androidx.compose.ui.Modifier).border(androidx.compose.foundation.BorderStroke,androidx.compose.ui.graphics.Shape)` |   |