Border

Apply a border to the specified composable

View in Playground

Constructors

Function

fun Border(size: Dp, color: Color) = Border(size, SolidColor(color))
  • size – the thickness of the border
    • required
  • color – the Color to be used for the border
    • required

Class

@Immutable
data class Border(val size: Dp, val brush: Brush)
  • size – the thickness of the border
    • required
  • brush – a reference to a Brush instance, used for the styling of the border
    • required

Examples

Using the Border Function

When calling the Border function there are two required properties:

Box(
    backgroundColor = Color.LightGray,
    border = Border(2.dp, Color.Black)
)

Border

Using the Border Class

When using the Border class directly there are two required properties:

Box(
    backgroundColor = Color.LightGray,
    border = Border(2.dp, SolidColor(Color.Red))
)

Border using brush