Compose Modifier

border

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

border

Source set: Common
public fun Modifier.border(border: BorderStroke, shape: Shape = RectangleShape): Modifier

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

Source set: Common
public fun Modifier.border(width: Dp, color: Color, shape: Shape = RectangleShape): Modifier

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

Source set: Common
public fun Modifier.border(width: Dp, brush: Brush, shape: Shape): Modifier

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
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: