androidx.compose.foundation

border

Function · from org.jetbrains.compose.foundation:foundation:1.12.2

No hand-written docs yet.

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

With border

fun Modifier.border(
    border: BorderStroke,
    shape: Shape = RectangleShape,
): T

border: BorderStrokeRequired

BorderStroke class that specifies border appearance, such as size and color

shape: ShapeOptional

Default: RectangleShape

shape of the border

With color

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

width: DpRequired

width of the border. Use Dp.Hairline for a hairline border.

color: ColorRequired

color to paint the border with

Same as above: shape.

With brush

fun Modifier.border(
    width: Dp,
    brush: Brush,
    shape: Shape,
)

brush: BrushRequired

brush to paint the border with

Same as above: width, shape.

Library docs

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