dashedBorder

fun Modifier.dashedBorder(border: BorderStroke, shape: Shape = RectangleShape, on: Dp, off: Dp): Modifier

Modify element to add border with appearance specified with a border and a shape, pad the content by the BorderStroke.width and clip it.

Parameters

border

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

shape

shape of the border

Samples

androidx.compose.foundation.samples.BorderSample
fun Modifier.dashedBorder(width: Dp, color: Color, shape: Shape = RectangleShape, on: Dp, off: Dp): Modifier

Returns a Modifier that adds border with appearance specified with width, color and a shape, pads the content by the width and clips 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

on

the size of the solid part of the dashes

off

the size of the space between dashes


fun Modifier.dashedBorder(width: Dp, brush: Brush, shape: Shape, on: Dp, off: Dp): Modifier

Returns a Modifier that adds border with appearance specified with width, brush and a shape, pads the content by the width and clips 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