State of Compose 2023 results are in! Click here to learn more

← Back to Foundation

DrawBorder

Component
in
Foundation
. Since 0.1.0-dev15

Overview

Code Examples

Returns a Modifier that adds border with appearance specified with size, color and a shape

Overloads

DrawBorder

@Deprecated(
    "Use Modifier.drawBorder",
    replaceWith = ReplaceWith(
        "Modifier.drawBorder(size, color, shape)",
        "androidx.compose.ui.Modifier",
        "androidx.compose.foundation.drawBorder",
        "androidx.compose.foundation.shape.RectangleShape"
    )
)
@Composable
fun DrawBorder(size: Dp, color: Color, shape: Shape = RectangleShape)

Parameters

NameDescription
sizewidth of the border. Use Dp.Hairline for a hairline border.
colorcolor to paint the border with
shapeshape of the borde

DrawBorder

@Deprecated(
    "Use Modifier.drawBorder",
    replaceWith = ReplaceWith(
        "Modifier.drawBorder(size, brush, shape)",
        "androidx.compose.ui.Modifier",
        "androidx.compose.foundation.drawBorder",
        "androidx.compose.foundation.shape.RectangleShape"
    )
)
@Composable
fun DrawBorder(size: Dp, brush: Brush, shape: Shape)

Parameters

NameDescription
sizewidth of the border. Use Dp.Hairline for a hairline border.
brushbrush to paint the border with
shapeshape of the borde