Compose Modifier

border

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

border

Common
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

border

Common
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

border

Common
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